1
0
mirror of https://github.com/Refactorio/RedMew.git synced 2025-01-18 03:21:47 +02:00

Optimize some reach distances

This commit is contained in:
Lynn 2019-06-01 17:11:17 +02:00
parent cff6fe8db9
commit f73e017e88
2 changed files with 3 additions and 2 deletions

View File

@ -82,7 +82,6 @@ Retailer.item_types = {
item_package = 'item_package',
}
local market_gui_close_distance_squared = 6 * 6 + 6 * 6
local do_update_market_gui -- token
---Global storage
@ -704,7 +703,8 @@ Event.on_nth_tick(37, function()
local delta_x = player_position.x - market_position.x
local delta_y = player_position.y - market_position.y
if delta_x * delta_x + delta_y * delta_y > market_gui_close_distance_squared then
local reach_distance = player.reach_distance * 1.05
if delta_x * delta_x + delta_y * delta_y > reach_distance * reach_distance then
close_market_gui(player)
end
else

View File

@ -23,6 +23,7 @@ end
function SetupPlayer.on_init()
game.forces.player.manual_mining_speed_modifier = config.initial_mining_speed_bonus
game.forces.player.character_resource_reach_distance_bonus = 1
end
return SetupPlayer