mirror of
https://github.com/mangosfour/server.git
synced 2025-12-27 01:37:04 +00:00
[11282] Use uint32 datatype for aura charges and stacks
* Some spells have StackAmount > 255, for example 22735, 54314 * In SMSG_AURA_UPDATE maximum stack amount is limited by 255 * Move duplicate code into SpellAuraHolder::BuildUpdatePacket function * Cleanup some weird type casts in _LoadAuras
This commit is contained in:
parent
77e612cbf7
commit
0bc4bc1d75
8 changed files with 62 additions and 102 deletions
|
|
@ -1206,18 +1206,18 @@ void Pet::_LoadAuras(uint32 timediff)
|
|||
uint64 caster_guid = fields[0].GetUInt64();
|
||||
uint32 item_lowguid = fields[1].GetUInt32();
|
||||
uint32 spellid = fields[2].GetUInt32();
|
||||
uint32 stackcount= fields[3].GetUInt32();
|
||||
int32 remaincharges = (int32)fields[4].GetUInt32();
|
||||
uint32 stackcount = fields[3].GetUInt32();
|
||||
uint32 remaincharges = fields[4].GetUInt32();
|
||||
int32 damage[MAX_EFFECT_INDEX];
|
||||
int32 maxduration[MAX_EFFECT_INDEX];
|
||||
int32 remaintime[MAX_EFFECT_INDEX];
|
||||
for (int32 i = 0; i < MAX_EFFECT_INDEX; ++i)
|
||||
{
|
||||
damage[i] = (int32)fields[i+5].GetUInt32();
|
||||
maxduration[i] = (int32)fields[i+8].GetUInt32();
|
||||
remaintime[i] = (int32)fields[i+11].GetUInt32();
|
||||
damage[i] = fields[i+5].GetInt32();
|
||||
maxduration[i] = fields[i+8].GetInt32();
|
||||
remaintime[i] = fields[i+11].GetInt32();
|
||||
}
|
||||
uint32 effIndexMask = (int32)fields[14].GetUInt32();
|
||||
uint32 effIndexMask = fields[14].GetUInt32();
|
||||
|
||||
SpellEntry const* spellproto = sSpellStore.LookupEntry(spellid);
|
||||
if (!spellproto)
|
||||
|
|
@ -1234,7 +1234,7 @@ void Pet::_LoadAuras(uint32 timediff)
|
|||
uint32 procCharges = spellproto->procCharges;
|
||||
if (procCharges)
|
||||
{
|
||||
if (remaincharges <= 0 || remaincharges > (int32)procCharges)
|
||||
if (remaincharges <= 0 || remaincharges > procCharges)
|
||||
remaincharges = procCharges;
|
||||
}
|
||||
else
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue