Skip to content

Commit 5391a31

Browse files
committed
don't try redrawing outside an update
1 parent d0c3a88 commit 5391a31

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

src/Engine.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ std::string Engine::executeNetwork(std::string in) {
172172
}
173173

174174
bool Engine::needsUpdate() {
175-
return (!world.paused) && (fastticks || !backend->ticks() || (backend->ticks() > (tickdata + world.ticktime)));
175+
return fastticks || !backend->ticks() || (backend->ticks() > (tickdata + world.ticktime));
176176
}
177177

178178
unsigned int Engine::msUntilTick() {
@@ -235,9 +235,11 @@ bool Engine::tick() {
235235

236236
// tick+draw the world, if necessary
237237
bool needupdate = needsUpdate();
238-
if (needupdate)
239-
update();
240-
drawWorld();
238+
if (needupdate) {
239+
if (!world.paused)
240+
update();
241+
drawWorld();
242+
}
241243

242244
processEvents();
243245
if (needupdate)

0 commit comments

Comments
 (0)