Skip to content
This repository was archived by the owner on Jan 5, 2024. It is now read-only.

Commit ef299ec

Browse files
committed
Bunker Breach edits to hopefully fix losing conditions and defenders standing around
1 parent 7a6f4cd commit ef299ec

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Base.rte/Activities/BunkerBreach.lua

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -249,12 +249,13 @@ function BunkerBreach:UpdateActivity()
249249
local team = self:GetTeamOfPlayer(player);
250250
local brain = self:GetPlayerBrain(player);
251251
--Look for a new brain
252-
if not brain or not MovableMan:ValidMO(brain) then
252+
if not brain or not MovableMan:IsActor(brain) then
253253
brain = MovableMan:GetUnassignedBrain(team);
254-
if brain then
254+
if brain and MovableMan:IsActor(brain) then
255255
self:SetPlayerBrain(brain, player);
256256
self:SwitchToActor(brain, player, team);
257257
else
258+
brain = nil;
258259
self:SetPlayerBrain(nil, player);
259260
end
260261
end
@@ -354,7 +355,7 @@ function BunkerBreach:UpdateActivity()
354355
if self.sendGoldDiggers then
355356
self:CreateDrop(self.CPUTeam, "Engineer", Actor.AIMODE_GOLDDIG);
356357
else
357-
self:CreateDrop(self.CPUTeam, "Any", enemyUnitRatio < RangeRand(1.5, 0.5) and Actor.AIMODE_BRAINHUNT or Actor.AIMODE_PATROL);
358+
self:CreateDrop(self.CPUTeam, "Any", enemyUnitRatio > math.random() and Actor.AIMODE_BRAINHUNT or Actor.AIMODE_PATROL);
358359
end
359360
self.CPUSpawnDelay = (40000 - self.difficultyRatio * 20000 + enemyUnitRatio * 7500) * rte.SpawnIntervalScale;
360361
end

0 commit comments

Comments
 (0)