mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
fix: getGunner returns null object if pilot uses manual fire if no gunner is present
This commit is contained in:
parent
26d282c224
commit
105184ce88
@ -16,8 +16,10 @@ private ["_vehicle", "_weapon"];
|
||||
_vehicle = _this select 0;
|
||||
_weapon = _this select 1;
|
||||
|
||||
// on foot
|
||||
if (gunner _vehicle == _vehicle && {_weapon in weapons _vehicle}) exitWith {gunner _vehicle};
|
||||
|
||||
// inside vehicle
|
||||
private "_gunner";
|
||||
_gunner = objNull;
|
||||
|
||||
@ -27,4 +29,9 @@ _gunner = objNull;
|
||||
};
|
||||
} forEach allTurrets [_vehicle, true];
|
||||
|
||||
// ensure that at least the pilot is returned if there is no gunner
|
||||
if (isManualFire _vehicle && {isNull _gunner}) then {
|
||||
_gunner = driver _vehicle;
|
||||
};
|
||||
|
||||
_gunner
|
||||
|
Loading…
Reference in New Issue
Block a user