Core/ScriptSystem: Add compile time type check of function assigned to hooks -

prevents incorrect function calls. Since this rev you have to put
PrepareAuraScript(<yourscriptclassnamehere>) at the beginning of every aura
script.

--HG--
branch : trunk
This commit is contained in:
QAston
2010-10-08 22:33:21 +02:00
parent ce712adda2
commit f8a4312701
11 changed files with 34 additions and 7 deletions
@@ -33,6 +33,7 @@ public:
class spell_gen_aura_of_anger_AuraScript : public AuraScript
{
PrepareAuraScript(spell_gen_aura_of_anger_AuraScript)
void HandleEffectPeriodicUpdate(AuraEffect * aurEff)
{
if (AuraEffect * aurEff1 = aurEff->GetBase()->GetEffect(EFFECT_1))
@@ -60,6 +61,7 @@ public:
class spell_gen_burn_brutallus_AuraScript : public AuraScript
{
PrepareAuraScript(spell_gen_burn_brutallus_AuraScript)
void HandleEffectPeriodicUpdate(AuraEffect * aurEff)
{
if (aurEff->GetTickNumber() % 11 == 0)
@@ -92,6 +94,7 @@ public:
class spell_gen_parachute_AuraScript : public AuraScript
{
PrepareAuraScript(spell_gen_parachute_AuraScript)
bool Validate(SpellEntry const * /*spellEntry*/)
{
if (!sSpellStore.LookupEntry(SPELL_PARACHUTE))
@@ -231,6 +234,7 @@ public:
class spell_gen_leeching_swarm_AuraScript : public AuraScript
{
PrepareAuraScript(spell_gen_leeching_swarm_AuraScript)
bool Validate(SpellEntry const * /*spellEntry*/)
{
if (!sSpellStore.LookupEntry(SPELL_LEECHING_SWARM_DMG))
@@ -400,6 +404,7 @@ class spell_creature_permanent_feign_death : public SpellScriptLoader
class spell_creature_permanent_feign_deathAuraScript : public AuraScript
{
PrepareAuraScript(spell_creature_permanent_feign_deathAuraScript)
void HandleEffectApply(AuraEffect const * /*aurEff*/, AuraApplication const * aurApp, AuraEffectHandleModes /*mode*/)
{
Unit* pTarget = aurApp->GetTarget();
@@ -345,6 +345,7 @@ public:
class spell_hun_sniper_training_AuraScript : public AuraScript
{
PrepareAuraScript(spell_hun_sniper_training_AuraScript)
bool Validate(SpellEntry const * /*entry*/)
{
if (!sSpellStore.LookupEntry(SPELL_SNIPER_TRAINING_R1))
+1
View File
@@ -684,6 +684,7 @@ public:
class spell_item_shadowmourne_AuraScript : public AuraScript
{
public:
PrepareAuraScript(spell_item_shadowmourne_AuraScript)
spell_item_shadowmourne_AuraScript() : AuraScript() { }
bool Validate(SpellEntry const* /*spellEntry*/)
@@ -100,6 +100,7 @@ public:
class spell_pal_blessing_of_sanctuary_AuraScript : public AuraScript
{
PrepareAuraScript(spell_pal_blessing_of_sanctuary_AuraScript)
bool Validate(SpellEntry const* /*entry*/)
{
if (!sSpellStore.LookupEntry(PALADIN_SPELL_BLESSING_OF_SANCTUARY_BUFF))
@@ -101,6 +101,7 @@ public:
class spell_rog_prey_on_the_weak_AuraScript : public AuraScript
{
PrepareAuraScript(spell_rog_prey_on_the_weak_AuraScript)
bool Validate(SpellEntry const * /*spellEntry*/)
{
if (!sSpellStore.LookupEntry(ROGUE_SPELL_PREY_ON_THE_WEAK))