Common - Only switch side if necessary on person loading (#6334)

Co-authored-by: Serg Vergun <1197314+severgun@users.noreply.github.com>
Co-authored-by: jonpas <jonpas33@gmail.com>
This commit is contained in:
BaerMitUmlaut 2021-10-10 16:26:36 +02:00 committed by GitHub
parent 0a203fdde4
commit 6128b8ef06
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -30,7 +30,15 @@ if (isNull _vehicle) then {
};
if (!isNull _vehicle) then {
[_unit, true, GROUP_SWITCH_ID, side group _caller] call FUNC(switchToGroupSide);
switch (true) do {
case ((crew _vehicle isEqualTo []) && {side group _caller != side group _unit}): {
[_unit, true, GROUP_SWITCH_ID, side group _caller] call FUNC(switchToGroupSide);
};
case (side group _vehicle != side group _unit): {
[_unit, true, GROUP_SWITCH_ID, side group _vehicle] call FUNC(switchToGroupSide);
};
};
TRACE_3("sending ace_loadPersonEvent",_unit,_vehicle,_caller);
["ace_loadPersonEvent", [_unit, _vehicle, _caller], _unit] call CBA_fnc_targetEvent;
};