Clear the top variable when the event is not valid too

This commit is contained in:
smallmodel 2025-01-17 16:21:13 +01:00
parent 7f0c506fea
commit 87e5b6d41e
No known key found for this signature in database
GPG key ID: 9F2D623CEDF08512

View file

@ -541,8 +541,8 @@ void ScriptVM::executeCommandInternal<false>(
) )
{ {
transferVarsToEvent(ev, fromVar, iParamCount); transferVarsToEvent(ev, fromVar, iParamCount);
checkValidEvent(ev, listener);
checkValidEvent(ev, listener);
listener->ProcessScriptEvent(ev); listener->ProcessScriptEvent(ev);
} }
@ -552,9 +552,9 @@ void ScriptVM::executeCommandInternal<true>(
) )
{ {
transferVarsToEvent(ev, fromVar, iParamCount); transferVarsToEvent(ev, fromVar, iParamCount);
checkValidEvent(ev, listener);
try { try {
checkValidEvent(ev, listener);
listener->ProcessScriptEvent(ev); listener->ProcessScriptEvent(ev);
} catch (...) { } catch (...) {
m_VMStack.GetTop().Clear(); m_VMStack.GetTop().Clear();