mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Minor improvements
This commit is contained in:
parent
e2a9917c53
commit
dfc018a031
@ -39,11 +39,12 @@ if (_object getVariable [QGVAR(isAmmoDetonating), false]) exitWith {};
|
||||
|
||||
_object setVariable [QGVAR(isAmmoDetonating), true, true];
|
||||
|
||||
_object setVariable [QGVAR(cookoffMagazines), _object call FUNC(getVehicleAmmo)];
|
||||
// Make sure that virtual magazines have been reset
|
||||
_object setVariable [QGVAR(virtualMagazines), nil];
|
||||
|
||||
// Save the vehicle's ammo, so it won't be removed during cook-off
|
||||
if (!GVAR(removeAmmoDuringCookoff)) then {
|
||||
_object setVariable [QGVAR(cookoffMagazines), _object call FUNC(getVehicleAmmo)];
|
||||
_object setVariable [QGVAR(cookoffMagazines), [_object, true] call FUNC(getVehicleAmmo)];
|
||||
};
|
||||
|
||||
[LINKFUNC(detonateAmmunitionServerLoop), [_object, _destroyWhenFinished, _source, _instigator], _initialDelay] call CBA_fnc_waitAndExecute;
|
||||
|
@ -27,7 +27,7 @@ private _objectAmmo = _object getVariable QGVAR(cookoffMagazines);
|
||||
private _removeAmmoDuringCookoff = isNil "_objectAmmo";
|
||||
|
||||
if (_removeAmmoDuringCookoff) then {
|
||||
_objectAmmo = _object call FUNC(getVehicleAmmo);
|
||||
_objectAmmo = [_object, true] call FUNC(getVehicleAmmo);
|
||||
};
|
||||
|
||||
_objectAmmo params ["_magazines", "_totalAmmo"];
|
||||
|
@ -5,6 +5,7 @@
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Object <OBJECT>
|
||||
* 1: If the virtual magazine count should be set <BOOL> (default: false)
|
||||
*
|
||||
* Return Value:
|
||||
* 0: Ammo array <ARRAY>
|
||||
@ -20,7 +21,7 @@
|
||||
* Public: No
|
||||
*/
|
||||
|
||||
params ["_object"];
|
||||
params ["_object", ["_setVirtualAmmoCount", false]];
|
||||
TRACE_1("getVehicleAmmo",_object);
|
||||
|
||||
private _ammoToDetonate = [];
|
||||
@ -80,7 +81,9 @@ if (isNil "_virtualAmmo") then {
|
||||
_totalAmmo = _totalAmmo + 10;
|
||||
};
|
||||
|
||||
_object setVariable [QGVAR(virtualMagazines), _virtualAmmo];
|
||||
if (_setVirtualAmmoCount) then {
|
||||
_object setVariable [QGVAR(virtualMagazines), _virtualAmmo];
|
||||
};
|
||||
} else {
|
||||
{
|
||||
_totalAmmo = _totalAmmo + (_x select 1);
|
||||
|
Loading…
Reference in New Issue
Block a user