mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-15 20:52:22 -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:
@@ -138,6 +138,7 @@ public:
|
||||
|
||||
class spell_gen_pet_summonedSpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_gen_pet_summonedSpellScript)
|
||||
void HandleScript(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
Unit *caster = GetCaster();
|
||||
@@ -194,6 +195,7 @@ public:
|
||||
|
||||
class spell_gen_remove_flight_auras_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_gen_remove_flight_auras_SpellScript)
|
||||
void HandleScript(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
Unit *target = GetHitUnit();
|
||||
@@ -287,6 +289,7 @@ public:
|
||||
|
||||
class spell_gen_trick_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_gen_trick_SpellScript)
|
||||
bool Validate(SpellEntry const * /*spellEntry*/)
|
||||
{
|
||||
if (!sSpellStore.LookupEntry(SPELL_PIRATE_COSTUME_MALE))
|
||||
@@ -357,6 +360,7 @@ public:
|
||||
|
||||
class spell_gen_trick_or_treat_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_gen_trick_or_treat_SpellScript)
|
||||
bool Validate(SpellEntry const * /*spellEntry*/)
|
||||
{
|
||||
if (!sSpellStore.LookupEntry(SPELL_TRICK))
|
||||
@@ -431,6 +435,7 @@ public:
|
||||
|
||||
class spell_pvp_trinket_wotf_shared_cd_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_pvp_trinket_wotf_shared_cd_SpellScript)
|
||||
bool Validate(SpellEntry const * /*spellEntry*/)
|
||||
{
|
||||
if (!sSpellStore.LookupEntry(SPELL_WILL_OF_THE_FORSAKEN_COOLDOWN_TRIGGER))
|
||||
|
||||
Reference in New Issue
Block a user