From a0b737d7fbf5cef41db418365516b55a6814bdaa Mon Sep 17 00:00:00 2001 From: Valansch Date: Sun, 11 Feb 2018 21:45:16 +0100 Subject: [PATCH] fixed crash --- custom_commands.lua | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/custom_commands.lua b/custom_commands.lua index 2c4a2611..516876f7 100644 --- a/custom_commands.lua +++ b/custom_commands.lua @@ -89,11 +89,10 @@ local function walkabout(cmd) if duration < 15 then duration = 15 end local player = game.players[player_name] - if player == nil or global.walking[player_name:lower()] then + if type(player) ~= "table" or global.walking[player_name:lower()] then player_print(player_name .. " could not go on a walkabout.") return end - local chunks = {} for chunk in player.surface.get_chunks() do table.insert(chunks, chunk) @@ -440,7 +439,7 @@ commands.add_command("kill", "Will kill you.", kill) commands.add_command("tpplayer", " - Teleports you to the player. (Admins and moderators)", teleport_player) commands.add_command("invoke", " - Teleports the player to you. (Admins and moderators)", invoke) commands.add_command("tppos", "Teleports you to a selected entity. (Admins only)", teleport_location) -commands.add_command("walkabout", ' <"close", "far", "very far", number> - Send someone on a walk. (Admins and moderators)', walkabout) +commands.add_command("walkabout", ' - Send someone on a walk. (Admins and moderators)', walkabout) commands.add_command("market", 'Places a fish market near you. (Admins only)', spawn_market) commands.add_command("regulars", 'Prints a list of game regulars.', print_regulars) commands.add_command("regular", ', Change regular status of a player. (Admins and moderators)', regular)