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

Commit 1b27354

Browse files
committed
Fix "Siege" activity potentially deleting the player's brain unit by accident
1 parent 8ed469a commit 1b27354

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Base.rte/Activities/Siege.lua

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ function Siege:StartActivity()
7777
for actor in MovableMan.AddedActors do
7878
if actor.Team == self.PlayerTeam and actor:IsInGroup("Brains") then
7979
playerBrainsLocation = actor.Pos
80+
break
8081
end
8182
end
8283
end
@@ -108,10 +109,9 @@ function Siege:StartActivity()
108109
-- Set all useless actors, i.e. those who should guard brain in the brain chamber but their brain is in another castle
109110
-- to delete themselves, because otherwise they are most likely to stand there for the whole battle and waste MOs
110111
for actor in MovableMan.AddedActors do
111-
if actor.Team == self.PlayerTeam and self.BrainChamber:IsInside(actor.Pos) and
112-
SceneMan:ShortestDistance(actor.Pos, playerBrainsLocation, false).Magnitude > 200 and
113-
actor.ClassName == "AHuman" or actor.ClassName == "ACrab" then
114-
-- actor.AIMode = Actor.AIMODE_BRAINHUNT;
112+
if actor.Team == self.PlayerTeam and self.BrainChamber:IsInside(actor.Pos)
113+
and SceneMan:ShortestDistance(actor.Pos, playerBrainsLocation, false).Magnitude > 200
114+
and not actor:HasObjectInGroup("Brains") and (actor.ClassName == "AHuman" or actor.ClassName == "ACrab") then
115115
actor.ToDelete = true
116116
end
117117
end

0 commit comments

Comments
 (0)