From 925e47dba28651a46ea776e79536da494a7f398c Mon Sep 17 00:00:00 2001 From: Rolf van Kleef Date: Mon, 23 Apr 2018 21:36:37 +0200 Subject: [PATCH] Fixed race with showing creeper cards. --- scripts/states/endOfTurn.lua | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/scripts/states/endOfTurn.lua b/scripts/states/endOfTurn.lua index 1162c9b..356c316 100644 --- a/scripts/states/endOfTurn.lua +++ b/scripts/states/endOfTurn.lua @@ -7,10 +7,14 @@ -- local menu = {} -- previously: Gamestate.new() menu.name = "endOfTurn" +menu.is_ran = false function menu:enter(prev) menu.prev = prev - menu.changes, menu.creepers = scripts.helpers.gamerules.endTurn(STATE) - scripts.helpers.gamerules.startTurn(STATE) + if not menu.is_ran then + menu.changes, menu.creepers = scripts.helpers.gamerules.endTurn(STATE) + scripts.helpers.gamerules.startTurn(STATE) + menu.is_ran = true + end -- setup entities here menu.t = 0.3 end @@ -31,6 +35,7 @@ function menu:update(dt) menu.t = 0.7 local c = STATE.hand[1] if not c then + menu.is_ran = false Gamestate.switch(scripts.states.dealHand) else STATE.discardPile[#STATE.discardPile+1] = c