Too Close Warning of /make-warp

This commit is contained in:
Cooldude2606
2018-05-02 19:36:40 +01:00
parent 12e0f3adc7
commit 7d8f367692
2 changed files with 3 additions and 0 deletions

View File

@@ -97,6 +97,8 @@ commands.add_command('make-warp', 'Make a warp point at your location', {'name',
local position = game.player.position
local name = args.name
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
make_warp_point(position,game.player.surface,game.player.force,name)
end)