Skip to content

Commit

Permalink
Clear the top variable when the event is not valid too
Browse files Browse the repository at this point in the history
  • Loading branch information
smallmodel committed Jan 17, 2025
1 parent 7f0c506 commit 87e5b6d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions code/script/scriptvm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -541,8 +541,8 @@ void ScriptVM::executeCommandInternal<false>(
)
{
transferVarsToEvent(ev, fromVar, iParamCount);
checkValidEvent(ev, listener);

checkValidEvent(ev, listener);
listener->ProcessScriptEvent(ev);
}

Expand All @@ -552,9 +552,9 @@ void ScriptVM::executeCommandInternal<true>(
)
{
transferVarsToEvent(ev, fromVar, iParamCount);
checkValidEvent(ev, listener);

try {
checkValidEvent(ev, listener);
listener->ProcessScriptEvent(ev);
} catch (...) {
m_VMStack.GetTop().Clear();
Expand Down

0 comments on commit 87e5b6d

Please sign in to comment.