mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-24 02:46:33 +01: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:
@@ -7242,7 +7242,7 @@ void Spell::CallScriptBeforeHitHandlers()
|
||||
std::list<SpellScript::HitHandler>::iterator hookItrEnd = (*scritr)->BeforeHit.end(), hookItr = (*scritr)->BeforeHit.begin();
|
||||
for(; hookItr != hookItrEnd ; ++hookItr)
|
||||
{
|
||||
((*scritr)->*(*hookItr))();
|
||||
(*hookItr).Call(*scritr);
|
||||
}
|
||||
(*scritr)->_FinishScriptCall();
|
||||
}
|
||||
@@ -7256,7 +7256,7 @@ void Spell::CallScriptOnHitHandlers()
|
||||
std::list<SpellScript::HitHandler>::iterator hookItrEnd = (*scritr)->OnHit.end(), hookItr = (*scritr)->OnHit.begin();
|
||||
for(; hookItr != hookItrEnd ; ++hookItr)
|
||||
{
|
||||
((*scritr)->*(*hookItr))();
|
||||
(*hookItr).Call(*scritr);
|
||||
}
|
||||
(*scritr)->_FinishScriptCall();
|
||||
}
|
||||
@@ -7270,7 +7270,7 @@ void Spell::CallScriptAfterHitHandlers()
|
||||
std::list<SpellScript::HitHandler>::iterator hookItrEnd = (*scritr)->AfterHit.end(), hookItr = (*scritr)->AfterHit.begin();
|
||||
for(; hookItr != hookItrEnd ; ++hookItr)
|
||||
{
|
||||
((*scritr)->*(*hookItr))();
|
||||
(*hookItr).Call(*scritr);
|
||||
}
|
||||
(*scritr)->_FinishScriptCall();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user