mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-18 06:00:10 -04:00
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:
@@ -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*/)
|
||||
|
||||
Reference in New Issue
Block a user