130 SCR_BaseCompartmentManagerComponent compartmentManager = SCR_BaseCompartmentManagerComponent.Cast(playerContext.m_Vehicle.FindComponent(SCR_BaseCompartmentManagerComponent));
131 if (!compartmentManager)
134 array<IEntity> occupants = {};
135 compartmentManager.GetOccupants(occupants);
137 if (occupants.Count() <= 1)
141 if (playerContext.m_bPilot)
143 array<IEntity> checkPilot = {};
146 if (checkPilot.IsEmpty())
148 Print(
"DataCollectorDriveModule: Pilot died but according to the compartmentManager there's no pilot. !!!",
LogLevel.ERROR);
151 else if (playerContext.m_Player != checkPilot.Get(0))
153 Print(
"DataCollectorDriveModule: The pilot from the context is not the pilot from the compartments. !!",
LogLevel.ERROR);
158 GetGame().GetDataCollector().GetPlayerData(PlayerID).AddStat(
SCR_EDataStats.PLAYERS_DIED_IN_VEHICLE, occupants.Count()-1);
163 array<IEntity> pilot = {};
171 int pilotID =
GetGame().GetPlayerManager().GetPlayerIdFromControlledEntity(pilot.Get(0));
177 GetGame().GetDataCollector().GetPlayerData(PlayerID).AddStat(
SCR_EDataStats.PLAYERS_DIED_IN_VEHICLE, 1);
187 if (instigator.GetInstigatorType() !=
InstigatorType.INSTIGATOR_PLAYER)
194 int killerId = instigator.GetInstigatorPlayerID();
198 if (!killerContext || !killerContext.m_bPilot)
209 if (!instigatorContextData.IsEnemyKillPunished(SCR_EDisguisedKillingPunishment.WARCRIME))
219 if (instigatorContextData.DoesPlayerKillCountAsTeamKill())
229 if (instigator.GetInstigatorType() !=
InstigatorType.INSTIGATOR_PLAYER)
236 int killerId = instigator.GetInstigatorPlayerID();
238 SCR_ChimeraCharacter AIEntityChar = SCR_ChimeraCharacter.Cast(AIEntity);
244 if (!killerContext || !killerContext.m_bPilot)
253 if (!instigatorContextData.IsEnemyKillPunished(SCR_EDisguisedKillingPunishment.WARCRIME))
263 if (instigatorContextData.DoesPlayerKillCountAsTeamKill())
292 array<int> playerIDsToRemove = {};
295 if (!playerContext.m_Player || !playerContext.m_Vehicle)
297 Print(
"DataCollectorDriverModule:Update: this context's player or vehicle is null. Player ID: " + playerId +
". Seems wrong",
LogLevel.WARNING);
299 if (!playerIDsToRemove.Contains(playerId))
300 playerIDsToRemove.Insert(playerId);
305 Physics physics = playerContext.m_Vehicle.GetPhysics();
308 Print(
"DataCollectorDriverModule:Update: Couldn't find the vehicle's physics. Player ID: " + playerId +
". Player is a pilot: " + playerContext.m_bPilot,
LogLevel.WARNING);
310 if (!playerIDsToRemove.Contains(playerId))
311 playerIDsToRemove.Insert(playerId);
317 if (distanceTraveled < 1)
323 if (playerContext.m_bPilot)
329 SCR_BaseCompartmentManagerComponent compartmentManagerComponent = SCR_BaseCompartmentManagerComponent.Cast(playerContext.m_Vehicle.FindComponent(SCR_BaseCompartmentManagerComponent));
330 if (!compartmentManagerComponent)
332 Print(
"DataCollectorDriverModule:Update: Could not add POINTS_AS_DRIVER_OF_PLAYERS because could find this vehicle's compartmentManagerComponent",
LogLevel.WARNING);
336 array<IEntity> occupants = {};
337 compartmentManagerComponent.GetOccupants(occupants);
338 int crewSize = occupants.Count();
341 foreach (
IEntity occupant : occupants)
354 CharacterControllerComponent characterController = character.GetCharacterController();
356 if (!characterController || !characterController.IsDead())
389 foreach (
int playerIdToRemove : playerIDsToRemove)