diff --git a/lib/gamestate.lua b/lib/gamestate.lua index 3661b0a..eae1447 100644 --- a/lib/gamestate.lua +++ b/lib/gamestate.lua @@ -45,7 +45,8 @@ function GS.push(to, ...) assert(to, "Missing argument: Gamestate to switch to") assert(to ~= GS, "Can't call push with colon operator") local pre = stack[#stack] - ;(to.load or __NULL__)(to) + ;(to.load or __NULL__)(to) -- modified to use load instead of init so as + -- to not interfere with 30log. to.load = nil stack[#stack+1] = to return (to.enter or __NULL__)(to, pre, ...) @@ -53,7 +54,7 @@ end function GS.pop(...) assert(#stack > 1, "No more states to pop!") - local pre, to = stack[#stack], stack[#stack-1] + local pre, to = stack[#stack], stack[#stack-1] stack[#stack] = nil ;(pre.leave or __NULL__)(pre) return (to.resume or __NULL__)(to, pre, ...) @@ -90,4 +91,4 @@ setmetatable(GS, {__index = function(_, func) end end}) -return GS \ No newline at end of file +return GS diff --git a/main.lua b/main.lua index b8c070e..0407663 100644 --- a/main.lua +++ b/main.lua @@ -1,6 +1,6 @@ class = require "lib.30log" tiny = require "lib.tiny" -gamestate = require "lib.gamestate" +gamestate = require "lib.gamestate" -- slightly modified to play nice;y with 30log local Intro = require "src.states.Intro" local Level = require "src.states.Level"