Skip to content

Commit

Permalink
Fixed race with showing creeper cards.
Browse files Browse the repository at this point in the history
  • Loading branch information
rhbvkleef committed Apr 23, 2018
1 parent 78ebdb8 commit 925e47d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions scripts/states/endOfTurn.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 925e47d

Please sign in to comment.