mirror of
https://github.com/araxiaonline/TrinityCore2.git
synced 2026-06-17 21:39:52 -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:
@@ -45,6 +45,7 @@ class spell_mage_cold_snap : public SpellScriptLoader
|
||||
|
||||
class spell_mage_cold_snap_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_mage_cold_snap_SpellScript)
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
Unit *caster = GetCaster();
|
||||
@@ -89,6 +90,7 @@ class spell_mage_polymorph_cast_visual : public SpellScriptLoader
|
||||
|
||||
class spell_mage_polymorph_cast_visual_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_mage_polymorph_cast_visual_SpellScript)
|
||||
static const uint32 spell_list[6];
|
||||
|
||||
bool Validate(SpellEntry const * /*spellEntry*/)
|
||||
@@ -137,6 +139,7 @@ class spell_mage_summon_water_elemental : public SpellScriptLoader
|
||||
|
||||
class spell_mage_summon_water_elemental_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_mage_summon_water_elemental_SpellScript)
|
||||
bool Validate(SpellEntry const * /*spellEntry*/)
|
||||
{
|
||||
if (!sSpellStore.LookupEntry(SPELL_MAGE_GLYPH_OF_ETERNAL_WATER))
|
||||
@@ -180,6 +183,7 @@ class spell_mage_blast_wave : public SpellScriptLoader
|
||||
|
||||
class spell_mage_blast_wave_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_mage_blast_wave_SpellScript)
|
||||
bool Validate(SpellEntry const * /*spellEntry*/)
|
||||
{
|
||||
if (!sSpellStore.LookupEntry(SPELL_MAGE_GLYPH_OF_BLAST_WAVE))
|
||||
|
||||
Reference in New Issue
Block a user