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
2010-10-08 21:33:44 +02:00
parent e5e53498ce
commit 1760e42e2c
23 changed files with 120 additions and 15 deletions
@@ -44,6 +44,7 @@ public:
class spell_warl_demonic_empowerment_SpellScript : public SpellScript
{
PrepareSpellScript(spell_warl_demonic_empowerment_SpellScript)
bool Validate(SpellEntry const * /*spellEntry*/)
{
if (!sSpellStore.LookupEntry(WARLOCK_DEMONIC_EMPOWERMENT_SUCCUBUS))
@@ -113,6 +114,7 @@ public:
class spell_warl_everlasting_affliction_SpellScript : public SpellScript
{
PrepareSpellScript(spell_warl_everlasting_affliction_SpellScript)
void HandleScriptEffect(SpellEffIndex /*effIndex*/)
{
if (Unit* unitTarget = GetHitUnit())
@@ -141,6 +143,7 @@ public:
class spell_warl_create_healthstone_SpellScript : public SpellScript
{
PrepareSpellScript(spell_warl_create_healthstone_SpellScript)
static uint32 const iTypes[8][3];
bool Validate(SpellEntry const * /*spellEntry*/)