Simulationhandler fixes

1. Players inside Vehicles were not detected
2. It was checked on groups, if simulationEnabled. But must be checked on the units
This commit is contained in:
He-Man 2018-11-27 18:43:47 +01:00 committed by GitHub
parent 6ed84e53bd
commit 901339c334
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -157,30 +157,32 @@ _fn_monitorGroupWaypoints = {
_fn_simulationMonitor = {
private["_playerType","_players"];
_playerType = ["LandVehicle","SHIP","AIR","TANK"];
if (blck_modType isEqualTo "Exile") then
{
_playerType = ["Exile_Unit_Player"];
_playerType = _playerType + ["Exile_Unit_Player"];
}else{
_playerType = ["Epoch_Male_F","Epoch_Female_F"];
_playerType = _playerType + ["Epoch_Male_F","Epoch_Female_F"];
};
{
_players = (leader _x) nearEntities [_playerType, blck_simulationEnabledDistance];
_players = ((leader _x) nearEntities [_playerType, blck_simulationEnabledDistance]) select {isplayer _x};
if (count _players > 0) then
{
{
if !(simulationEnabled _x) then
{
{
_x enableSimulationGlobal true;
(_players select 0) reveal _x; // Force simulation on
}forEach (units _x);
};
}forEach (units _x);
}else{
// Be sure simulation is off for all units in the group.
{
if (simulationEnabled _x) then
{
{_x enableSimulationGlobal false}forEach (units _x);
_x enableSimulationGlobal false;
};
}forEach (units _x);
};
} forEach blck_monitoredMissionAIGroups;
};