From bdd90cf0681eefc95aed1d9a3d9f0cabb3e2e71b Mon Sep 17 00:00:00 2001 From: Cooldude2606 Date: Fri, 15 Feb 2019 15:02:41 +0000 Subject: [PATCH] Fixed Homes of same name being counted twise --- modules/ExpGamingCommands/home/control.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ExpGamingCommands/home/control.lua b/modules/ExpGamingCommands/home/control.lua index 53b9481b..5edc3fbb 100644 --- a/modules/ExpGamingCommands/home/control.lua +++ b/modules/ExpGamingCommands/home/control.lua @@ -20,8 +20,8 @@ commands.add_command('home', 'Allows you to set, remove and goto your homes', { if command == 'set' then local pos = {math.floor(player.position.x),math.floor(player.position.y)} if homes._n+1 > homes._m then player_return{'ExpGamingCommands-home.too-many-homes',homes._m} return commands.error end + if not homes[name] then homes._n=homes._n+1 end homes[name] = pos - 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} return commands.error end