2015-10-03 23:26:38 +00:00
|
|
|
/*
|
|
|
|
* Author: commy2
|
|
|
|
* Returns the magazine of the units rangefinder.
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: Unit <OBJECT>
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* Magazine of the units binocular <STRING>
|
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
* [player] call ace_common_fnc_binocularMagazine
|
|
|
|
*
|
|
|
|
* Public: Yes
|
2015-10-04 10:10:08 +00:00
|
|
|
*
|
|
|
|
* Note: Doesn't work on dead units
|
2015-10-03 23:26:38 +00:00
|
|
|
*/
|
|
|
|
#include "script_component.hpp"
|
|
|
|
|
|
|
|
params ["_unit"];
|
|
|
|
|
|
|
|
private ["_binocular", "_muzzle", "_mode", "_magazine"];
|
|
|
|
|
|
|
|
_binocular = binocular _unit;
|
|
|
|
|
|
|
|
if (_binocular == "") exitWith {""};
|
|
|
|
|
|
|
|
_muzzle = currentMuzzle _unit;
|
|
|
|
_mode = currentWeaponMode _unit;
|
|
|
|
|
|
|
|
_unit selectWeapon _binocular;
|
|
|
|
|
2015-10-04 10:10:08 +00:00
|
|
|
// didn't select the binocular (unit probably dead or not local). function won't work. quit with empty string
|
|
|
|
if (currentWeapon _unit != _binocular) exitWith {""};
|
|
|
|
|
2015-10-03 23:26:38 +00:00
|
|
|
_magazine = currentMagazine _unit;
|
|
|
|
|
|
|
|
[_unit, _muzzle, _mode] call FUNC(selectWeaponMode);
|
|
|
|
|
|
|
|
_magazine
|