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)

View File

@@ -6,4 +6,5 @@ go-to-tooltip=Go To
cooldown=You must wait for the cooldown. Time left: __1__
cooldown-zero=Your cooldown has expired, You can use warp points again.
name-used=That name is already taken.
too-close=You are too close to an existing warp point to make a new one.
not-on-warp=You are not on a warp point right now, you must be on a warp point to go to one.