Fixed Homes of same name being counted twise

This commit is contained in:
Cooldude2606
2019-02-15 15:02:41 +00:00
parent b8beb2cf76
commit bdd90cf068

View File

@@ -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