mirror of
https://github.com/AquariaOSE/Aquaria.git
synced 2024-11-25 09:44:02 +00:00
Check against nesting recursive main()
This commit is contained in:
parent
02db145a01
commit
db4af79389
3 changed files with 10 additions and 1 deletions
|
@ -3617,6 +3617,14 @@ bool DSQ::isQuitFlag()
|
|||
return watchQuitFlag;
|
||||
}
|
||||
|
||||
void DSQ::run(float runTime /* = -1 */)
|
||||
{
|
||||
if(isDeveloperKeys() && isNested())
|
||||
errorLog("Warning: Nesting recursive main()");
|
||||
|
||||
Core::run(runTime);
|
||||
}
|
||||
|
||||
void DSQ::watch(float t, int canQuit)
|
||||
{
|
||||
watchQuitFlag = false;
|
||||
|
|
|
@ -353,6 +353,7 @@ public:
|
|||
void rumble(float leftMotor, float rightMotor, float time, int source, InputDevice device);
|
||||
void vision(std::string folder, int num, bool ignoreMusic = false);
|
||||
|
||||
void run(float runTime = -1); // same as Core::run() but with recursion check
|
||||
void watch(float t, int canQuit = 0);
|
||||
|
||||
std::string lastVoiceFile;
|
||||
|
|
|
@ -7141,7 +7141,7 @@ luaFunc(watch)
|
|||
|
||||
luaFunc(wait)
|
||||
{
|
||||
core->run(lua_tonumber(L, 1));
|
||||
dsq->run(lua_tonumber(L, 1)); // run() with recursion checking
|
||||
luaReturnNil();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue