mirror of
https://github.com/TombEngine/TombEngine.git
synced 2025-04-28 15:57:59 +03:00
Shorten TEN calls if they haven't yet been shortened; reset this flag when scripts are reset. Fixes #735
This commit is contained in:
parent
f5da03db9f
commit
27b1ad43f9
2 changed files with 10 additions and 2 deletions
|
@ -290,6 +290,8 @@ void LogicHandler::ResetScripts(bool clearGameVars)
|
|||
|
||||
m_handler.ResetGlobals();
|
||||
|
||||
m_shortenedCalls = false;
|
||||
|
||||
m_handler.GetState()->collect_garbage();
|
||||
}
|
||||
|
||||
|
@ -604,7 +606,12 @@ void LogicHandler::ShortenTENCalls()
|
|||
|
||||
void LogicHandler::ExecuteScriptFile(const std::string & luaFilename)
|
||||
{
|
||||
ShortenTENCalls();
|
||||
if (!m_shortenedCalls)
|
||||
{
|
||||
ShortenTENCalls();
|
||||
m_shortenedCalls = true;
|
||||
}
|
||||
|
||||
m_handler.ExecuteScript(luaFilename);
|
||||
}
|
||||
|
||||
|
|
|
@ -57,6 +57,8 @@ private:
|
|||
std::unordered_set<std::string> m_callbacksPreControl;
|
||||
std::unordered_set<std::string> m_callbacksPostControl;
|
||||
|
||||
bool m_shortenedCalls = false;
|
||||
|
||||
void ResetLevelTables();
|
||||
void ResetGameTables();
|
||||
LuaHandler m_handler;
|
||||
|
@ -99,5 +101,4 @@ public:
|
|||
void OnControlPhase(float dt) override;
|
||||
void OnSave() override;
|
||||
void OnEnd() override;
|
||||
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue