Skip to content

Commit

Permalink
Fix #52 - Gamestate require init function.
Browse files Browse the repository at this point in the history
Use __NULL__ when init is not defined in the state.
  • Loading branch information
vrld committed Oct 13, 2015
1 parent 37f4ed9 commit f851254
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gamestate.lua
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ local function change_state(stack_offset, to, ...)
local pre = stack[#stack]

-- initialize only on first call
;(initialized_states[to] or to.init)(to)
;(initialized_states[to] or to.init or __NULL__)(to)
initialized_states[to] = __NULL__

stack[#stack+stack_offset] = to
Expand Down

0 comments on commit f851254

Please sign in to comment.