mirror of
https://github.com/a-bad-dev/simple-shooter-game.git
synced 2026-06-08 20:12:11 +00:00
Fix a crash and use nil instead of a string in certain places
This commit is contained in:
parent
d927dd70ab
commit
2061af0645
3 changed files with 5 additions and 5 deletions
|
|
@ -15,7 +15,7 @@ core.register_chatcommand("start", {
|
||||||
|
|
||||||
local sucess = start_match(param)
|
local sucess = start_match(param)
|
||||||
|
|
||||||
if map_data == "nope :(" then
|
if not map_data then
|
||||||
return false, "-!- Map not found!"
|
return false, "-!- Map not found!"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -117,8 +117,8 @@ function start_match(map) -- Start the match
|
||||||
|
|
||||||
map_data = place_map(map or "forest") -- default to forest if no map is specified
|
map_data = place_map(map or "forest") -- default to forest if no map is specified
|
||||||
|
|
||||||
if map_data == "nope :(" then
|
if not map_data then
|
||||||
return map_data
|
return nil
|
||||||
end
|
end
|
||||||
|
|
||||||
set_match_state("pre_match")
|
set_match_state("pre_match")
|
||||||
|
|
@ -191,7 +191,7 @@ function end_match() -- End the match
|
||||||
set_match_state("not_started")
|
set_match_state("not_started")
|
||||||
|
|
||||||
for _, player in pairs(core.get_connected_players()) do
|
for _, player in pairs(core.get_connected_players()) do
|
||||||
player:set_pos -- name kept for backwards compat(spawn_pos)
|
player:set_pos(spawn_pos)
|
||||||
player:get_inventory():set_list("main", {})
|
player:get_inventory():set_list("main", {})
|
||||||
|
|
||||||
player:set_inventory_formspec([[
|
player:set_inventory_formspec([[
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ function place_map(map)
|
||||||
if map_list[i] == map then
|
if map_list[i] == map then
|
||||||
break
|
break
|
||||||
elseif i == #map_list then
|
elseif i == #map_list then
|
||||||
return "nope :("
|
return nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue