From 35be7538797242c8f1e7a77a30075d9e029de06d Mon Sep 17 00:00:00 2001 From: Aaron Veden Date: Sat, 19 Mar 2022 16:38:54 -0700 Subject: [PATCH] FACTO-65: Removed squad refunds above squad limit from vanilla or other mods --- changelog.txt | 1 + control.lua | 21 --------------------- 2 files changed, 1 insertion(+), 21 deletions(-) diff --git a/changelog.txt b/changelog.txt index 44b94f0..44d9607 100644 --- a/changelog.txt +++ b/changelog.txt @@ -8,6 +8,7 @@ Version: 3.0.0 - Added surface minime_dummy_dungeon and minime-preview-character to exclusion list - Increased unit spawner cooldown by 2x - Added point loss on unit death + - Removed squad refunds when vanilla AI or other mods create enemy unit groups above the squad limit Bugfixes: - Fixed Krastorio2 on_force_created playerforces being nil - Fixed enemy map scan creating bases unnecessarily diff --git a/control.lua b/control.lua index f391b7e..7c84ce2 100644 --- a/control.lua +++ b/control.lua @@ -765,10 +765,6 @@ local function onUnitGroupCreated(event) if not settler and (universe.squadCount > universe.AI_MAX_SQUAD_COUNT) then group.destroy() - base.unitPoints = base.unitPoints + AI_SQUAD_COST - if universe.aiPointsPrintGainsToChat then - game.print(map.surface.name .. ": Points: +" .. AI_SQUAD_COST .. ". [Squad Refund] Total: " .. string.format("%.2f", base.unitPoints)) - end return end @@ -794,10 +790,6 @@ local function onUnitGroupCreated(event) if not settler and (universe.squadCount > universe.AI_MAX_SQUAD_COUNT) then group.destroy() - base.unitPoints = base.unitPoints + AI_SQUAD_COST - if universe.aiPointsPrintGainsToChat then - game.print(map.surface.name .. ": Points: +" .. AI_SQUAD_COST .. ". [Squad Refund] Total: " .. string.format("%.2f", base.unitPoints)) - end return end @@ -826,26 +818,17 @@ local function onGroupFinishedGathering(event) map.activeSurface = true local squad = universe.groupNumberToSquad[group.group_number] if squad then - local base = squad.base if squad.settler then if (universe.builderCount < universe.AI_MAX_BUILDER_COUNT) then squadDispatch(map, squad, event.tick) else group.destroy() - base.unitPoints = base.unitPoints + AI_SETTLER_COST - if universe.aiPointsPrintGainsToChat then - game.print(map.surface.name .. ": Points: +" .. AI_SETTLER_COST .. ". [Settler Refund] Total: " .. string.format("%.2f", base.unitPoints)) - end end else if (universe.squadCount < universe.AI_MAX_SQUAD_COUNT) then squadDispatch(map, squad, event.tick) else group.destroy() - base.unitPoints = base.unitPoints + AI_SQUAD_COST - if universe.aiPointsPrintGainsToChat then - game.print(map.surface.name .. ": Points: +" .. AI_SQUAD_COST .. ". [Squad Refund] Total: " .. string.format("%.2f", base.unitPoints)) - end end end else @@ -857,10 +840,6 @@ local function onGroupFinishedGathering(event) if not settler and (universe.squadCount > universe.AI_MAX_SQUAD_COUNT) then group.destroy() - base.unitPoints = base.unitPoints + AI_SQUAD_COST - if universe.aiPointsPrintGainsToChat then - game.print(map.surface.name .. ": Points: +" .. AI_SQUAD_COST .. ". [Squad Refund] Total: " .. string.format("%.2f", base.unitPoints)) - end return end