Skip to content

Commit

Permalink
Mtn: fix fluidboxes
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerkiz committed Oct 26, 2024
1 parent fb6ab43 commit 42b9762
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 16 deletions.
7 changes: 3 additions & 4 deletions maps/mountain_fortress_v3/functions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ local function do_refill_turrets()

local data = turret_data.data
if data.liquid then
turret.fluidbox[1] = data
turret.set_fluid(1, data)
elseif data then
turret.insert(data)
end
Expand Down Expand Up @@ -278,11 +278,10 @@ local function do_magic_fluid_crafters()

if fcount > 0 then
local fluidbox_index = data.fluidbox_index
local fb = entity.fluidbox

local fb_data = fb[fluidbox_index] or { name = data.item, amount = 0 }
local fb_data = entity.get_fluid(fluidbox_index) or { name = data.item, amount = 0 }
fb_data.amount = fb_data.amount + fcount
fb[fluidbox_index] = fb_data
entity.set_fluid(fluidbox_index, fb_data)

entity.products_finished = entity.products_finished + fcount

Expand Down
12 changes: 2 additions & 10 deletions maps/mountain_fortress_v3/icw/functions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -244,20 +244,12 @@ local function equal_fluid(source_tank, target_tank)
return
end

if #source_tank.fluidbox < 1 then
return
end

if #target_tank.fluidbox < 1 then
return
end

local source_fluid = source_tank.fluidbox[1] ~= nil and source_tank.fluidbox[1]
local source_fluid = source_tank.get_fluid(1) ~= nil and source_tank.get_fluid(1)
if not source_fluid then
return
end

local target_fluid = target_tank.fluidbox[1]
local target_fluid = target_tank.get_fluid(1)
local source_fluid_amount = source_fluid.amount

local amount
Expand Down
4 changes: 4 additions & 0 deletions maps/mountain_fortress_v3/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -565,6 +565,10 @@ local collapse_after_wave_200 = function ()
return
end

if WD.get('paused') then
return
end

local wave_number = WD.get_wave()

if wave_number >= 200 and not Collapse.has_collapse_started() then
Expand Down
2 changes: 1 addition & 1 deletion maps/scrap_towny_ffa/team.lua
Original file line number Diff line number Diff line change
Expand Up @@ -967,7 +967,7 @@ local function setup_enemy_force()
if not surface or not surface.valid then
return
end
e_force.set_evolution_factor(1, surface) -- this should never change since we are changing biter types on spawn
e_force.set_evolution_factor(1, surface.name) -- this should never change since we are changing biter types on spawn
e_force.set_friend(game.forces.player, true) -- outlander force (player) should not be attacked by turrets
e_force.set_cease_fire(game.forces.player, true) -- outlander force (player) should not be attacked by units
if (this.testing_mode == true) then
Expand Down
2 changes: 1 addition & 1 deletion utils/gui/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -754,7 +754,7 @@ local function build_config_gui(data)
if Module.collapse_grace then
switch_state = 'left'
end
add_switch(scroll_pane, switch_state, 'collapse_grace', 'Collapse', 'On = Enables collapse after wave 100.\nOff = Disables collapse - you must breach the first zone for collapse to occur.')
add_switch(scroll_pane, switch_state, 'collapse_grace', 'Collapse', 'On = Enables collapse after wave 200.\nOff = Disables collapse - you must breach the first zone for collapse to occur.')

scroll_pane.add({ type = 'line' })

Expand Down

0 comments on commit 42b9762

Please sign in to comment.