Skip to content

Commit

Permalink
Add logic for army pool detection and disband blocking (#4412)
Browse files Browse the repository at this point in the history
  • Loading branch information
relent0r committed Nov 18, 2022
1 parent 36e2535 commit cd5ca04
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions lua/aibrain.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1532,6 +1532,7 @@ AIBrain = Class(moho.aibrain_methods) {
-- TURNING OFF AI POOL PLATOON, I MAY JUST REMOVE THAT PLATOON FUNCTIONALITY LATER
local poolPlatoon = self:GetPlatoonUniquelyNamed('ArmyPool')
if poolPlatoon then
poolPlatoon.ArmyPool = true
poolPlatoon:TurnOffPoolAI()
end

Expand Down
5 changes: 5 additions & 0 deletions lua/platoon.lua
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,11 @@ Platoon = Class(moho.platoon_methods) {

---@param self Platoon
PlatoonDisband = function(self)
if self.ArmyPool then
WARN('AI WARNING: Platoon trying to disband ArmyPool')
--LOG(reprsl(debug.traceback()))
return
end
local aiBrain = self:GetBrain()
if self.BuilderHandle then
self.BuilderHandle:RemoveHandle(self)
Expand Down

0 comments on commit cd5ca04

Please sign in to comment.