mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Small cleanup
This commit is contained in:
parent
f74162411c
commit
463309db2d
@ -16,7 +16,7 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_magazineClass", "_magazines", "_turretPath"];
|
||||
private ["_magazineClass", "_turretPath"];
|
||||
params ["_target", "_unit"];
|
||||
|
||||
if (GVAR(level) == 0 || {isNull _unit} || {!(_unit isKindOf "CAManBase")} || {!local _unit} || {_target distance _unit > REARM_ACTION_DISTANCE}) exitWith {false};
|
||||
@ -24,4 +24,4 @@ if (GVAR(level) == 0 || {isNull _unit} || {!(_unit isKindOf "CAManBase")} || {!l
|
||||
_magazineClass = _unit getVariable QGVAR(carriedMagazine);
|
||||
if (isNil "_magazineClass") exitWith {false};
|
||||
|
||||
([_target, _magazines, _magazineClass] call FUNC(getNeedRearmMagazines)) select 0
|
||||
([_target, _magazineClass] call FUNC(getNeedRearmMagazines)) select 0
|
||||
|
@ -4,24 +4,25 @@
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Target <OBJECT>
|
||||
* 1: Magazines <ARRAY>
|
||||
* 2: Magazine Classname <STRING>
|
||||
* 3: Turret Path <ARRAY>
|
||||
* 1: Magazine Classname <STRING>
|
||||
*
|
||||
* Return Value:
|
||||
* Return Value <BOOL>
|
||||
* Return Value <ARRAY>
|
||||
* 0: Can Rearm <BOOL>
|
||||
* 1: TurretPath <ARRAY>
|
||||
* 2: Magazine Classname <STRING>
|
||||
*
|
||||
* Example:
|
||||
* [tank, ["mag1", "mag2"], "mag", [0]] call ace_rearm_fnc_getNeedRearmMagazines
|
||||
* [tank, "mag"] call ace_rearm_fnc_getNeedRearmMagazines
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_return", "_cnt"];
|
||||
params ["_target", "_magazines", "_magazineClass"];
|
||||
private ["_return", "_magazines", "_cnt"];
|
||||
params ["_target", "_magazineClass"];
|
||||
|
||||
_return = [false];
|
||||
_return = [false, [], 0];
|
||||
{
|
||||
_magazines = _target magazinesTurret _x;
|
||||
|
||||
|
@ -24,8 +24,8 @@ private "_dummy";
|
||||
_dummy = _unit getVariable [QGVAR(dummy), objNull];
|
||||
|
||||
if (!isNull _dummy) then {
|
||||
_dummy setVariable [QGVAR(carriedMagazine), _unit getVariable QGVAR(carriedMagazine)];
|
||||
detach _dummy;
|
||||
deleteVehicle _dummy; // TODO remove when moved to CfgVehicles
|
||||
};
|
||||
|
||||
_unit setVariable [QGVAR(dummy), nil];
|
||||
|
@ -46,7 +46,7 @@ if (_idx == -1) then {
|
||||
};
|
||||
|
||||
// Get magazines that can be rearmed
|
||||
_needRearmMags = [_target, _magazines, _magazineClass] call FUNC(getNeedRearmMagazines);
|
||||
_needRearmMags = [_target, _magazineClass] call FUNC(getNeedRearmMagazines);
|
||||
_needRearmMags params ["_needRearm", "_turretPath", "_cnt"];
|
||||
|
||||
// Exit if no magazines need rearming
|
||||
|
Loading…
Reference in New Issue
Block a user