Fix /restart not working in editor
parent
f3c854a34d
commit
955b031b8a
|
@ -221,9 +221,12 @@ minetest.register_chatcommand("restart", {
|
||||||
params = "",
|
params = "",
|
||||||
description = S("Restart current level"),
|
description = S("Restart current level"),
|
||||||
func = function(name, param)
|
func = function(name, param)
|
||||||
if lzr_gamestate.get_state() == lzr_gamestate.LEVEL then
|
local state = lzr_gamestate.get_state()
|
||||||
|
if state == lzr_gamestate.LEVEL or state == lzr_gamestate.EDITOR then
|
||||||
lzr_levels.start_level(current_level)
|
lzr_levels.start_level(current_level)
|
||||||
return true
|
return true
|
||||||
|
elseif state == lzr_gamestate.LEVEL_COMPLETE then
|
||||||
|
return false, S("Can’t restart level right now.")
|
||||||
else
|
else
|
||||||
return false, S("Not playing in a level!")
|
return false, S("Not playing in a level!")
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue