mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 23:50:44 +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:
@@ -167,6 +167,16 @@ void SpellScript::EffectHandler::Call(SpellScript * spellScript, SpellEffIndex e
|
||||
(spellScript->*pEffectHandlerScript)(effIndex);
|
||||
}
|
||||
|
||||
SpellScript::HitHandler::HitHandler(SpellHitFnType _pHitHandlerScript)
|
||||
{
|
||||
pHitHandlerScript = _pHitHandlerScript;
|
||||
}
|
||||
|
||||
void SpellScript::HitHandler::Call(SpellScript * spellScript)
|
||||
{
|
||||
(spellScript->*pHitHandlerScript)();
|
||||
}
|
||||
|
||||
bool SpellScript::_Validate(SpellEntry const * entry)
|
||||
{
|
||||
for (std::list<EffectHandler>::iterator itr = OnEffect.begin(); itr != OnEffect.end(); ++itr)
|
||||
|
||||
Reference in New Issue
Block a user