make public

This commit is contained in:
Salluci 2023-07-13 20:01:33 +03:00
parent 7647123683
commit 4e8c69e08a
3 changed files with 18 additions and 11 deletions

View File

@ -5,7 +5,6 @@ PREP(aceRearmGetCarryMagazines);
PREP(ai_handleFired);
PREP(ai_handleGetIn);
PREP(ai_reload);
PREP(ai_unloadMagazines);
PREP(assemble_canDeployTripod);
PREP(assemble_canDeployWeapon);
@ -37,6 +36,7 @@ PREP(reload_handleAddTurretMag);
PREP(reload_handleRemoveTurretMag);
PREP(reload_handleReturnAmmo);
PREP(reload_loadMagazine);
PREP(unloadMagazines);
PREP(staticWeaponInit);
PREP(staticWeaponInit_unloadExtraMags);

View File

@ -23,7 +23,7 @@ if (_loadableMagazines isEqualTo []) exitWith {TRACE_1("could not find reloadabl
private _forcedMag = _vehicle getVariable [QGVAR(forcedMag), ""];
// If this is called while CSW has ammo, unload mags in gunner's turret
if (someAmmo _vehicle) then {[_vehicle, _gunner, [_gunner] call EFUNC(common,getTurretIndex)] call FUNC(ai_unloadMagazine)};
if (someAmmo _vehicle) then {[_vehicle, [_gunner] call EFUNC(common,getTurretIndex)] call FUNC(unloadMagazines)};
private _bestAmmo = 0;
private _magazineInfo = [];

View File

@ -1,19 +1,24 @@
#include "script_component.hpp"
/*
* Author: LinkIsGrim
* Switch loaded magazine on an AI CSW
* Unloads and returns magazines from a CSW
*
* Arguments:
* 0: CSW <OBJECT>
* 1: Gunner <OBJECT>
* 2: Turret Path <ARRAY>
* 0: CSW <OBJECT> (default: objNull)
* 1: Turret Path <ARRAY> (default: [0], gunner turret)
* 2: Return removed magazines <BOOL> (default: true)
*
* Return Value:
* None
*
* Public: No
* Example:
* [cursorTarget, [0]] call ace_csw_fnc_unloadMagazines
*
* Public: Yes
*/
params ["_vehicle", "_gunner", "_turretPath"];
params [["_vehicle", objNull, [objNull]], ["_turretPath", [0], [0]], ["_returnMags", true, [true]]];
if (isNull _vehicle) exitWith {};
private _magsToRemove = [];
private _containerMagazineClassnames = [];
@ -38,6 +43,8 @@ private _containerMagazineCount = [];
_vehicle removeMagazinesTurret _x;
} forEach _magsToRemove;
{
[_vehicle, _x, _containerMagazineCount select _forEachIndex] call FUNC(reload_handleReturnAmmo);
} forEach _containerMagazineClassnames;
if (_returnMags) then {
{
[_vehicle, _x, _containerMagazineCount select _forEachIndex] call FUNC(reload_handleReturnAmmo);
} forEach _containerMagazineClassnames;
};