mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2025-12-30 04:21:41 +09:00
Bug Fixes Round One
This commit is contained in:
@@ -241,7 +241,7 @@ script.on_event(defines.events.on_player_created, function(event)
|
||||
text='Warp: Spawn',
|
||||
icon={type='item',name=warp_item}
|
||||
})
|
||||
global.warps['Spawn'] = {tag=tag,surface=player.surface.index,position={0,0}}
|
||||
global.warps['Spawn'] = {tag=tag,surface=player.surface.index,position={x=0,y=0}}
|
||||
end
|
||||
end)
|
||||
|
||||
|
||||
@@ -11,8 +11,8 @@ commands.add_command('make-warp', 'Make a warp point at your location', {
|
||||
if game.player.gui.top[name] then player_return({'WarpPoints.name-used'},defines.textcolor.med) return commands.error end
|
||||
if warps.warps[name] then player_return({'WarpPoints.name-used'},defines.textcolor.med) return commands.error end
|
||||
for name,warp in pairs(warps.warps) do
|
||||
local dx = position.x-warp.position[1]
|
||||
local dy = position.y-warp.position[2]
|
||||
local dx = position.x-warp.position.x
|
||||
local dy = position.y-warp.position.y
|
||||
if dx^2 + dy^2 < warp_min_distance then player_return({'WarpPoints.too-close'},defines.textcolor.med) return commands.error end
|
||||
end
|
||||
-- to do add a test for all warps
|
||||
|
||||
Reference in New Issue
Block a user