Throw error in case of missing argument instead of silently failing

This commit is contained in:
Matthias Richter 2010-11-16 16:26:33 +01:00
parent 1e961e9a07
commit 902437d562

View File

@ -58,7 +58,7 @@ function Gamestate.new()
end
function Gamestate.switch(to, ...)
if not to then return end
assert(to, "Missing argument: Gamestate to switch to")
Gamestate.current:leave()
local pre = Gamestate.current
Gamestate.current = to