diff --git a/src/game/Pet.cpp b/src/game/Pet.cpp index d2b7b0207..a80f3f368 100644 --- a/src/game/Pet.cpp +++ b/src/game/Pet.cpp @@ -1220,7 +1220,7 @@ void Pet::_LoadAuras(uint32 timediff) uint32 effIndexMask = (int32)fields[14].GetUInt32(); SpellEntry const* spellproto = sSpellStore.LookupEntry(spellid); - if(!spellproto) + if (!spellproto) { sLog.outError("Unknown spell (spellid %u), ignore.",spellid); continue; @@ -1232,16 +1232,21 @@ void Pet::_LoadAuras(uint32 timediff) // prevent wrong values of remaincharges uint32 procCharges = spellproto->procCharges; - if(procCharges) + if (procCharges) { - if(remaincharges <= 0 || remaincharges > (int32)procCharges) + if (remaincharges <= 0 || remaincharges > (int32)procCharges) remaincharges = procCharges; } else remaincharges = 0; - if (spellproto->StackAmount < stackcount) + if (!spellproto->StackAmount) + stackcount = 1; + else if (spellproto->StackAmount < stackcount) stackcount = spellproto->StackAmount; + else if (!stackcount) + stackcount = 1; + SpellAuraHolder *holder = CreateSpellAuraHolder(spellproto, this, NULL); for (int32 i = 0; i < MAX_EFFECT_INDEX; ++i) diff --git a/src/game/Player.cpp b/src/game/Player.cpp index e4817a283..b1bec1635 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -15957,23 +15957,27 @@ void Player::_LoadAuras(QueryResult *result, uint32 timediff) uint32 effIndexMask = (int32)fields[14].GetUInt32(); SpellEntry const* spellproto = sSpellStore.LookupEntry(spellid); - if(!spellproto) + if (!spellproto) { sLog.outError("Unknown spell (spellid %u), ignore.",spellid); continue; } // prevent wrong values of remaincharges - if(spellproto->procCharges) + if (spellproto->procCharges) { - if(remaincharges <= 0 || remaincharges > (int32)spellproto->procCharges) + if (remaincharges <= 0 || remaincharges > (int32)spellproto->procCharges) remaincharges = spellproto->procCharges; } else remaincharges = 0; - if (spellproto->StackAmount < stackcount) + if (!spellproto->StackAmount) + stackcount = 1; + else if (spellproto->StackAmount < stackcount) stackcount = spellproto->StackAmount; + else if (!stackcount) + stackcount = 1; SpellAuraHolder *holder = CreateSpellAuraHolder(spellproto, this, NULL); for (int32 i = 0; i < MAX_EFFECT_INDEX; ++i) diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 3f82a6bef..31cde7368 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "11277" + #define REVISION_NR "11278" #endif // __REVISION_NR_H__