Core/ScriptSystem: Add compile time type check of function assigned to hooks - prevents incorrect function calls. Since this rev you have to put PrepareSpellScript(<yourscriptclassnamehere>) at the beginning of every spell script. Yes, i know it's unhandy, but unfortunately C++ preprocessor is very limited, so you have to do that extra work each time you write a script:(.

--HG--
branch : trunk
This commit is contained in:
QAston committed 2010-10-08 21:33:44 +02:00
1 parent e5e53498ce
commit 1760e42e2c
23 files changed
+120 -15

No files matched your search

@@ -46,6 +46,7 @@ public:
class spell_pal_blessing_of_faith_SpellScript : public SpellScript
{
PrepareSpellScript(spell_pal_blessing_of_faith_SpellScript)
bool Validate(SpellEntry const * /*spellEntry*/)
{
if (!sSpellStore.LookupEntry(SPELL_BLESSING_OF_LOWER_CITY_DRUID))
@@ -141,6 +142,7 @@ public:
class spell_pal_guarded_by_the_light_SpellScript : public SpellScript
{
PrepareSpellScript(spell_pal_guarded_by_the_light_SpellScript)
bool Validate(SpellEntry const * /*spellEntry*/)
{
if (!sSpellStore.LookupEntry(PALADIN_SPELL_DIVINE_PLEA))
@@ -174,6 +176,7 @@ public:
class spell_pal_holy_shock_SpellScript : public SpellScript
{
PrepareSpellScript(spell_pal_holy_shock_SpellScript)
bool Validate(SpellEntry const *spellEntry)
{
if (!sSpellStore.LookupEntry(PALADIN_SPELL_HOLY_SHOCK_R1))
@@ -227,6 +230,7 @@ public:
class spell_pal_judgement_of_command_SpellScript : public SpellScript
{
PrepareSpellScript(spell_pal_judgement_of_command_SpellScript)
void HandleDummy(SpellEffIndex /*effIndex*/)
{
if (Unit *unitTarget = GetHitUnit())