mirror of
https://github.com/vrld/hump.git
synced 2024-11-23 12:24:19 +00:00
Throw error in case of missing argument instead of silently failing
This commit is contained in:
parent
1e961e9a07
commit
902437d562
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user