1
0
mirror of https://github.com/ComfyFactory/ComfyFactorio.git synced 2025-03-17 20:58:13 +02:00
This commit is contained in:
danielmartin0 2022-05-05 10:14:22 +01:00
parent e41119e292
commit 50a8391152
3 changed files with 10 additions and 7 deletions

View File

@ -705,6 +705,7 @@ end
function Public.transfer_healthbar(old_unit_number, new_entity)
local memory = Memory.get_crew_memory()
local new_unit_number = new_entity.unit_number
if not memory.healthbars then return end
local old_healthbar = memory.healthbars[old_unit_number]
-- if new_surface_bool then

View File

@ -643,6 +643,13 @@ function Public.try_overworld_move_v2(vector) --islands stay, crowsnest moves
Common.notify_force(memory.force, message, CoreData.colors.notify_victory)
end
if vector.x > 0 then
Public.ensure_lane_generated_up_to(0, memory.overworldx + Crowsnest.Data.visibilitywidth)
Public.ensure_lane_generated_up_to(24, memory.overworldx + Crowsnest.Data.visibilitywidth)
Public.ensure_lane_generated_up_to(-24, memory.overworldx + Crowsnest.Data.visibilitywidth)
Public.overwrite_a_dock_upgrade()
end
if not Public.is_position_free_to_move_to{x = memory.overworldx + vector.x, y = memory.overworldy+ vector.y} then
if _DEBUG then log(string.format('can\'t move by ' .. vector.x .. ', ' .. vector.y)) end
return false
@ -652,11 +659,6 @@ function Public.try_overworld_move_v2(vector) --islands stay, crowsnest moves
if vector.x > 0 then
Public.ensure_lane_generated_up_to(0, memory.overworldx + Crowsnest.Data.visibilitywidth)
Public.ensure_lane_generated_up_to(24, memory.overworldx + Crowsnest.Data.visibilitywidth)
Public.ensure_lane_generated_up_to(-24, memory.overworldx + Crowsnest.Data.visibilitywidth)
Public.overwrite_a_dock_upgrade()
-- crew bonus resources per x:
local crew = Common.crew_get_crew_members()
for _, player in pairs(crew) do

View File

@ -726,7 +726,7 @@ local function process_entity_on_boat_unteleportable(memory, boat, newsurface, v
if ee and ee.valid then
if un and memory.healthbars[un] then
if un and memory.healthbars and memory.healthbars[un] then
Common.transfer_healthbar(un, ee)
end
@ -1007,7 +1007,7 @@ local function teleport_handle_wake_tiles(boat, dummyboat, newsurface_name, olds
for _, area in pairs(wakeareas) do
for _, p in pairs(Common.central_positions_within_area(area, adjustednewposition)) do
local t = old_water_tile
if static_params and static_params.deepwater_xposition and (p.x <= static_params.deepwater_xposition) then t = 'deepwater' end
if static_params and static_params.deepwater_xposition and (p.x <= static_params.deepwater_xposition - 0.5) then t = 'deepwater' end
if friendlyboat_bool and boat.state == enum_state.RETREATING and vector.x < 0 then --in this case we need to place some landing tiles, as the cannon juts out
if (p.x >= boat.dockedposition.x + scope.Data.leftmost_gate_position) and (p.y <= scope.Data.upmost_gate_position or p.y >= scope.Data.downmost_gate_position) then t = CoreData.landing_tile end
end