make getGunner work in person turret turret units (commander FFV) and for foot soldiers

This commit is contained in:
commy2 2015-04-02 13:52:22 +02:00
parent d8e0c54406
commit f2d802eb90

View File

@ -16,6 +16,8 @@ private ["_vehicle", "_weapon"];
_vehicle = _this select 0;
_weapon = _this select 1;
if (gunner _vehicle == _vehicle && {_weapon in weapons _vehicle}) exitWith {gunner _vehicle};
private "_gunner";
_gunner = objNull;
@ -23,6 +25,6 @@ _gunner = objNull;
if (_weapon in (_vehicle weaponsTurret _x)) exitWith {
_gunner = _vehicle turretUnit _x;
};
} forEach allTurrets _vehicle;
} forEach allTurrets [_vehicle, true];
_gunner