Fixed /make-warp name

This commit is contained in:
Cooldude2606
2018-05-26 11:39:57 +01:00
parent 9995cf0b72
commit 9041006c5a

View File

@@ -96,6 +96,7 @@ commands.add_command('make-warp', 'Make a warp point at your location', {'name',
if not game.player then return end
local position = game.player.position
local name = args.name
if player.gui.top[name] then player_return({'warp-system.name-used'},defines.text_color.med) return commands.error end
if _warps().warps[name] then player_return({'warp-system.name-used'},defines.text_color.med) return commands.error end
if position.x^2 + position.y^2 < 100 then player_return({'warp-system.too-close'},defines.text_color.med) return commands.error end
-- to do add a test for all warps