mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2025-12-27 19:45:22 +09:00
Too Close Warning of /make-warp
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
@@ -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.
|
||||
Reference in New Issue
Block a user