41 array<IEntity> presentEntities = {};
42 int presentEntitiesCount =
m_Trigger.GetEntitiesInside(presentEntities);
74 for (
int i = 0; i < presentEntitiesCount; i++)
76 IEntity entity = presentEntities[i];
80 RplComponent.DeleteRplEntity(entity,
false);
86 if (!evaluatedEntityFaction)
89 factionCount = factionsPresence.Get(evaluatedEntityFaction);
92 if (factionCount == 0)
93 factionsPresence.Insert(evaluatedEntityFaction, 1);
95 factionsPresence.Set(evaluatedEntityFaction, factionCount + 1);
99 factionsPlayerPresence.Set(evaluatedEntityFaction,
true);
102 int totalFactionPresenceCount, maxFactionPresence;
104 bool multipleMaxPresence;
105 foreach (
SCR_Faction faction,
int presence : factionsPresence)
107 totalFactionPresenceCount += presence;
110 if (presence > maxFactionPresence)
112 maxFactionPresence = presence;
113 multipleMaxPresence =
false;
115 else if (presence == maxFactionPresence)
117 multipleMaxPresence =
true;
124 if (defenderFaction && !factionsPresence.Contains(defenderFaction))
125 factionsPresence.Insert(defenderFaction, 0);
131 int curSeizingCharacters;
133 SCR_EBaseCaptureState baseCaptureState = SCR_EBaseCaptureState.NONE;
136 foreach (
SCR_Faction faction,
int presence : factionsPresence)
138 if (faction == defenderFaction)
141 if (presence * 2 >= totalFactionPresenceCount)
143 prevailingFaction = null;
144 curSeizingCharacters = 0;
149 if (baseCaptureState == SCR_EBaseCaptureState.NONE)
150 baseCaptureState = SCR_EBaseCaptureState.CONTESTED;
168 if (presence == maxFactionPresence && !multipleMaxPresence && cFaction && (!cFaction.IsPlayable() ||
m_Base.IsHQRadioTrafficPossible(cFaction)))
170 prevailingFaction = faction;
171 curSeizingCharacters = presence;
172 baseCaptureState = SCR_EBaseCaptureState.CAPTURING;
178 if (prevailingFaction)
236 array<SCR_EServicePointType> checkedTypes = {
253 int radioConnectionsCount;
254 SCR_CoverageRadioComponent comp = SCR_CoverageRadioComponent.Cast(
m_Base.GetOwner().FindComponent(SCR_CoverageRadioComponent));
260 if (faction && faction.IsPlayable())
261 radioConnectionsCount = comp.GetRadiosInRangeOfCount(faction.GetFactionRadioEncryptionKey());
273 float multiplier = 1;