Small cleanup

This commit is contained in:
IngoKauffmann 2015-08-18 16:20:11 +02:00
parent f74162411c
commit 463309db2d
4 changed files with 13 additions and 12 deletions

View File

@ -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

View File

@ -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;

View File

@ -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];

View File

@ -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