From 1ff69bcce0e4e5520f3e60165829f0428217558c Mon Sep 17 00:00:00 2001 From: collett Date: Thu, 2 Jan 2020 01:52:20 +0900 Subject: [PATCH] Fix non-existing lut entry being executed. --- src/world/Action/Action.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/world/Action/Action.cpp b/src/world/Action/Action.cpp index 550a7be3..871473e6 100644 --- a/src/world/Action/Action.cpp +++ b/src/world/Action/Action.cpp @@ -391,8 +391,9 @@ void Action::Action::buildEffects() snapshotAffectedActors( m_hitActors ); auto pScriptMgr = m_pFw->get< Scripting::ScriptMgr >(); + auto hasLutEntry = ActionLut::validEntryExists( static_cast< uint16_t >( getId() ) ); - if( !pScriptMgr->onExecute( *this ) && !ActionLut::validEntryExists( static_cast< uint16_t >( getId() ) ) ) + if( !pScriptMgr->onExecute( *this ) && !hasLutEntry ) { if( auto player = m_pSource->getAsPlayer() ) { @@ -402,7 +403,7 @@ void Action::Action::buildEffects() return; } - if( m_hitActors.empty() ) + if( !hasLutEntry || m_hitActors.empty() ) return; auto lutEntry = ActionLut::getEntry( static_cast< uint16_t >( getId() ) );