mirror of
https://github.com/mangosfour/server.git
synced 2025-12-12 19:37:03 +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
|
|
@ -4406,7 +4406,7 @@ void Unit::RemoveSingleAuraFromSpellAuraHolder(uint32 spellId, SpellEffectIndex
|
|||
}
|
||||
}
|
||||
|
||||
void Unit::RemoveAuraHolderDueToSpellByDispel(uint32 spellId, int32 stackAmount, uint64 casterGUID, Unit *dispeler)
|
||||
void Unit::RemoveAuraHolderDueToSpellByDispel(uint32 spellId, uint32 stackAmount, uint64 casterGUID, Unit *dispeller)
|
||||
{
|
||||
SpellEntry const* spellEntry = sSpellStore.LookupEntry(spellId);
|
||||
|
||||
|
|
@ -4424,7 +4424,7 @@ void Unit::RemoveAuraHolderDueToSpellByDispel(uint32 spellId, int32 stackAmount,
|
|||
RemoveAuraHolderFromStack(spellId, stackAmount, casterGUID, AURA_REMOVE_BY_DISPEL);
|
||||
|
||||
// backfire damage and silence
|
||||
dispeler->CastCustomSpell(dispeler, 31117, &damage, NULL, NULL, true, NULL, NULL,casterGUID);
|
||||
dispeller->CastCustomSpell(dispeller, 31117, &damage, NULL, NULL, true, NULL, NULL, casterGUID);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
@ -4574,14 +4574,14 @@ void Unit::RemoveAurasWithDispelType( DispelType type, uint64 casterGUID )
|
|||
}
|
||||
}
|
||||
|
||||
void Unit::RemoveAuraHolderFromStack(uint32 spellId, int32 stackAmount, uint64 casterGUID, AuraRemoveMode mode)
|
||||
void Unit::RemoveAuraHolderFromStack(uint32 spellId, uint32 stackAmount, uint64 casterGUID, AuraRemoveMode mode)
|
||||
{
|
||||
SpellAuraHolderBounds spair = GetSpellAuraHolderBounds(spellId);
|
||||
for(SpellAuraHolderMap::iterator iter = spair.first; iter != spair.second; ++iter)
|
||||
{
|
||||
if (!casterGUID || iter->second->GetCasterGUID() == casterGUID)
|
||||
{
|
||||
if (iter->second->ModStackAmount(-stackAmount))
|
||||
if (iter->second->ModStackAmount(-int32(stackAmount)))
|
||||
{
|
||||
RemoveSpellAuraHolder(iter->second, mode);
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue