From 4c63a6f5932be96dadb5bcc7003d6b12ed2c4b89 Mon Sep 17 00:00:00 2001 From: Simon Robertshaw Date: Sun, 19 Aug 2012 12:16:51 +0100 Subject: Fix the Lua EngineProcess bug, not sure how either (needs further investigation) I suspect that stacking Lua calls upon each other (which will happen in engine->Tick()/engine->Draw()) is causing some unusual behaviour, checking for an engine break just before this fixes it. fixes #129 diff --git a/src/PowderToySDL.cpp b/src/PowderToySDL.cpp index 7eb9366..61ca94d 100644 --- a/src/PowderToySDL.cpp +++ b/src/PowderToySDL.cpp @@ -294,11 +294,7 @@ void EngineProcess() SDL_Event event; while(engine->Running()) { - if(engine->Broken()) - { - engine->UnBreak(); - break; - } + if(engine->Broken()) { engine->UnBreak(); break; } event.type = 0; while (SDL_PollEvent(&event)) { @@ -360,6 +356,7 @@ void EngineProcess() } event.type = 0; //Clear last event } + if(engine->Broken()) { engine->UnBreak(); break; } engine->Tick(); engine->Draw(); -- cgit v0.9.2-21-gd62e