mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 19:37:02 +00:00
[10484] Use for auraholde/aura GetStackAmount uint32 result.
uint32 result used in most expressions for stack calculation/compare Alos uint8implicitly casted to int by C++ in expressions that generate unexpected signed/unsigned warnings in comparisons (uint8 +1) > uint32 and similar.
This commit is contained in:
parent
a3e62d43b0
commit
f0956e258c
5 changed files with 14 additions and 14 deletions
|
|
@ -8136,15 +8136,15 @@ bool SpellAuraHolder::ModStackAmount(int32 num)
|
|||
return false;
|
||||
}
|
||||
|
||||
void SpellAuraHolder::SetStackAmount(uint8 stackAmount)
|
||||
void SpellAuraHolder::SetStackAmount(uint32 stackAmount)
|
||||
{
|
||||
Unit *target = GetTarget();
|
||||
Unit *caster = GetCaster();
|
||||
if (!target || !caster)
|
||||
return;
|
||||
|
||||
bool refresh = stackAmount >= m_stackAmount;
|
||||
if (stackAmount != m_stackAmount)
|
||||
bool refresh = stackAmount >= uint32(m_stackAmount);
|
||||
if (stackAmount != uint32(m_stackAmount))
|
||||
{
|
||||
m_stackAmount = stackAmount;
|
||||
|
||||
|
|
|
|||
|
|
@ -58,8 +58,8 @@ class MANGOS_DLL_SPEC SpellAuraHolder
|
|||
void setDiminishGroup(DiminishingGroup group) { m_AuraDRGroup = group; }
|
||||
DiminishingGroup getDiminishGroup() const { return m_AuraDRGroup; }
|
||||
|
||||
uint8 GetStackAmount() { return m_stackAmount; }
|
||||
void SetStackAmount(uint8 stackAmount);
|
||||
uint32 GetStackAmount() { return m_stackAmount; }
|
||||
void SetStackAmount(uint32 stackAmount);
|
||||
bool ModStackAmount(int32 num); // return true if last charge dropped
|
||||
|
||||
Aura* GetAuraByEffectIndex(SpellEffectIndex index) const { return m_auras[index]; }
|
||||
|
|
@ -389,7 +389,7 @@ class MANGOS_DLL_SPEC Aura
|
|||
time_t GetAuraApplyTime() const { return m_applyTime; }
|
||||
uint32 GetAuraTicks() const { return m_periodicTick; }
|
||||
uint32 GetAuraMaxTicks() const { return m_maxduration > 0 && m_modifier.periodictime > 0 ? m_maxduration / m_modifier.periodictime : 0; }
|
||||
uint8 GetStackAmount() const { return GetHolder()->GetStackAmount(); }
|
||||
uint32 GetStackAmount() const { return GetHolder()->GetStackAmount(); }
|
||||
|
||||
void SetLoadedState(int32 damage,int32 maxduration,int32 duration)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1691,7 +1691,7 @@ void Spell::EffectDummy(SpellEffectIndex eff_idx)
|
|||
|
||||
if (Aura* pAura = m_caster->GetAura(spellShrink, EFFECT_INDEX_0))
|
||||
{
|
||||
uint8 stackNum = pAura->GetStackAmount();
|
||||
uint32 stackNum = pAura->GetStackAmount();
|
||||
|
||||
// chance to become pygmified (5, 10, 15 etc)
|
||||
if (roll_chance_i(stackNum*5))
|
||||
|
|
|
|||
|
|
@ -1891,7 +1891,7 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura
|
|||
triggered_spell_id = 31803; // Holy Vengeance
|
||||
|
||||
// Add 5-stack effect from Holy Vengeance
|
||||
int8 stacks = 0;
|
||||
uint32 stacks = 0;
|
||||
AuraList const& auras = target->GetAurasByType(SPELL_AURA_PERIODIC_DAMAGE);
|
||||
for(AuraList::const_iterator itr = auras.begin(); itr!=auras.end(); ++itr)
|
||||
{
|
||||
|
|
@ -1901,7 +1901,7 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura
|
|||
break;
|
||||
}
|
||||
}
|
||||
if(stacks >= 5)
|
||||
if (stacks >= 5)
|
||||
CastSpell(target,42463,true,NULL,triggeredByAura);
|
||||
break;
|
||||
}
|
||||
|
|
@ -1993,7 +1993,7 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura
|
|||
triggered_spell_id = 53742; // Blood Corruption
|
||||
|
||||
// Add 5-stack effect from Blood Corruption
|
||||
int8 stacks = 0;
|
||||
uint32 stacks = 0;
|
||||
AuraList const& auras = target->GetAurasByType(SPELL_AURA_PERIODIC_DAMAGE);
|
||||
for(AuraList::const_iterator itr = auras.begin(); itr!=auras.end(); ++itr)
|
||||
{
|
||||
|
|
@ -2003,7 +2003,7 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura
|
|||
break;
|
||||
}
|
||||
}
|
||||
if(stacks >= 5)
|
||||
if (stacks >= 5)
|
||||
CastSpell(target,53739,true,NULL,triggeredByAura);
|
||||
break;
|
||||
}
|
||||
|
|
@ -3127,7 +3127,7 @@ SpellAuraProcResult Unit::HandleProcTriggerSpellAuraProc(Unit *pVictim, uint32 d
|
|||
|
||||
Aura * dummy = GetDummyAura(37658);
|
||||
// release at 3 aura in stack (cont contain in basepoint of trigger aura)
|
||||
if(!dummy || dummy->GetStackAmount() < triggerAmount)
|
||||
if(!dummy || dummy->GetStackAmount() < uint32(triggerAmount))
|
||||
return SPELL_AURA_PROC_FAILED;
|
||||
|
||||
RemoveAurasDueToSpell(37658);
|
||||
|
|
@ -3152,7 +3152,7 @@ SpellAuraProcResult Unit::HandleProcTriggerSpellAuraProc(Unit *pVictim, uint32 d
|
|||
// counting
|
||||
Aura * dummy = GetDummyAura(54842);
|
||||
// release at 3 aura in stack (cont contain in basepoint of trigger aura)
|
||||
if(!dummy || dummy->GetStackAmount() < triggerAmount)
|
||||
if(!dummy || dummy->GetStackAmount() < uint32(triggerAmount))
|
||||
return SPELL_AURA_PROC_FAILED;
|
||||
|
||||
RemoveAurasDueToSpell(54842);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "10483"
|
||||
#define REVISION_NR "10484"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue