From 3dffadef543fc127d858ab634c4ad28f0d3c6876 Mon Sep 17 00:00:00 2001 From: Cooldude2606 Date: Sat, 19 Jan 2019 14:33:07 +0000 Subject: [PATCH] Fixed homes --- modules/ExpGamingCommands/home/control.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/ExpGamingCommands/home/control.lua b/modules/ExpGamingCommands/home/control.lua index d5c667fb..53b9481b 100644 --- a/modules/ExpGamingCommands/home/control.lua +++ b/modules/ExpGamingCommands/home/control.lua @@ -24,12 +24,12 @@ commands.add_command('home', 'Allows you to set, remove and goto your homes', { homes._n=homes._n+1 player_return{'ExpGamingCommands-home.set',name,pos[1],pos[2]} elseif command == 'remove' then - if not homes[name] then player_return{'ExpGamingCommands-home.invalid',name} end + if not homes[name] then player_return{'ExpGamingCommands-home.invalid',name} return commands.error end homes[name] = nil homes._n=homes._n-1 player_return{'ExpGamingCommands-home.remove',name} elseif command == 'goto' then - if not homes[name] then player_return{'ExpGamingCommands-home.invalid',name} end + if not homes[name] then player_return{'ExpGamingCommands-home.invalid',name} return commands.error end local pos = {math.floor(player.position.x),math.floor(player.position.y)} player.teleport(player.surface.find_non_colliding_position('player',homes[name],32,1),player.surface) homes._r = pos