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_handleFired);
PREP(ai_handleGetIn); PREP(ai_handleGetIn);
PREP(ai_reload); PREP(ai_reload);
PREP(ai_unloadMagazines);
PREP(assemble_canDeployTripod); PREP(assemble_canDeployTripod);
PREP(assemble_canDeployWeapon); PREP(assemble_canDeployWeapon);
@ -37,6 +36,7 @@ PREP(reload_handleAddTurretMag);
PREP(reload_handleRemoveTurretMag); PREP(reload_handleRemoveTurretMag);
PREP(reload_handleReturnAmmo); PREP(reload_handleReturnAmmo);
PREP(reload_loadMagazine); PREP(reload_loadMagazine);
PREP(unloadMagazines);
PREP(staticWeaponInit); PREP(staticWeaponInit);
PREP(staticWeaponInit_unloadExtraMags); 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), ""]; private _forcedMag = _vehicle getVariable [QGVAR(forcedMag), ""];
// If this is called while CSW has ammo, unload mags in gunner's turret // 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 _bestAmmo = 0;
private _magazineInfo = []; private _magazineInfo = [];

View File

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