mirror of
https://github.com/mangosfour/server.git
synced 2025-12-28 22:37:04 +00:00
[11585] Add countof macro
It can be used to calculate number of elements in static array. Do not use with pointers!
This commit is contained in:
parent
3788348b46
commit
4c81559800
3 changed files with 9 additions and 5 deletions
|
|
@ -769,14 +769,14 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura
|
|||
case CLASS_DRUID: // 39511,40997,40998,40999,41002,41005,41009,41011,41409
|
||||
{
|
||||
uint32 RandomSpell[]={39511,40997,40998,40999,41002,41005,41009,41011,41409};
|
||||
triggered_spell_id = RandomSpell[ irand(0, sizeof(RandomSpell)/sizeof(uint32) - 1) ];
|
||||
triggered_spell_id = RandomSpell[urand(0, countof(RandomSpell)-1)];
|
||||
break;
|
||||
}
|
||||
case CLASS_ROGUE: // 39511,40997,40998,41002,41005,41011
|
||||
case CLASS_WARRIOR: // 39511,40997,40998,41002,41005,41011
|
||||
{
|
||||
uint32 RandomSpell[]={39511,40997,40998,41002,41005,41011};
|
||||
triggered_spell_id = RandomSpell[ irand(0, sizeof(RandomSpell)/sizeof(uint32) - 1) ];
|
||||
triggered_spell_id = RandomSpell[urand(0, countof(RandomSpell)-1)];
|
||||
break;
|
||||
}
|
||||
case CLASS_PRIEST: // 40999,41002,41005,41009,41011,41406,41409
|
||||
|
|
@ -785,13 +785,13 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura
|
|||
case CLASS_WARLOCK: // 40999,41002,41005,41009,41011,41406,41409
|
||||
{
|
||||
uint32 RandomSpell[]={40999,41002,41005,41009,41011,41406,41409};
|
||||
triggered_spell_id = RandomSpell[ irand(0, sizeof(RandomSpell)/sizeof(uint32) - 1) ];
|
||||
triggered_spell_id = RandomSpell[urand(0, countof(RandomSpell)-1)];
|
||||
break;
|
||||
}
|
||||
case CLASS_HUNTER: // 40997,40999,41002,41005,41009,41011,41406,41409
|
||||
{
|
||||
uint32 RandomSpell[]={40997,40999,41002,41005,41009,41011,41406,41409};
|
||||
triggered_spell_id = RandomSpell[ irand(0, sizeof(RandomSpell)/sizeof(uint32) - 1) ];
|
||||
triggered_spell_id = RandomSpell[urand(0, countof(RandomSpell)-1)];
|
||||
break;
|
||||
}
|
||||
default:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue