Merge pull request #6333 from tjmgd/bug-lua-breakpoint-67

Fix: Lua breakpoint error
This commit is contained in:
Chris Galvan
2021-12-15 09:57:54 -06:00
committed by GitHub
@@ -105,6 +105,8 @@ void ScriptContextDebug::ConnectHook()
void ScriptContextDebug::DisconnectHook()
{
lua_sethook(m_context.NativeContext(), nullptr, 0, 0);
m_currentStackLevel = -1;
m_stepStackLevel = -1;
}
//=========================================================================
@@ -651,6 +653,11 @@ void AZ::LuaHook(lua_State* l, lua_Debug* ar)
context->PopCallstack();
}
context->m_currentStackLevel--;
if (context->m_currentStackLevel == -1)
{
context->m_stepStackLevel = -1;
}
}
else if (ar->event == LUA_HOOKLINE)
{