From 7d8f367692b951b466fc2487484d94ab11fb1b1c Mon Sep 17 00:00:00 2001 From: Cooldude2606 Date: Wed, 2 May 2018 19:36:40 +0100 Subject: [PATCH] Too Close Warning of /make-warp --- Addons/Guis/warp-system.lua | 2 ++ locale/en/warp-system.cfg | 1 + 2 files changed, 3 insertions(+) diff --git a/Addons/Guis/warp-system.lua b/Addons/Guis/warp-system.lua index 1b378438..b05a416f 100644 --- a/Addons/Guis/warp-system.lua +++ b/Addons/Guis/warp-system.lua @@ -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) diff --git a/locale/en/warp-system.cfg b/locale/en/warp-system.cfg index 20e2f769..b241d7b4 100644 --- a/locale/en/warp-system.cfg +++ b/locale/en/warp-system.cfg @@ -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. \ No newline at end of file