Update fnc_detonateAmmunitionServerLoop.sqf

This commit is contained in:
johnb432 2024-07-03 19:07:58 +02:00
parent dfc018a031
commit 76c3fdfd49

View File

@ -107,7 +107,7 @@ if (_removeAmmoDuringCookoff) then {
// Virtual magazines // Virtual magazines
case (_magazineInfo isEqualTo true): { case (_magazineInfo isEqualTo true): {
// Find the virtual magazines and update its count // Find the virtual magazines and update its count
private _virtualAmmo = _object getVariable QGVAR(virtualMagazines); private _virtualAmmo = _object getVariable [QGVAR(virtualMagazines), []];
_magazineIndex = _virtualAmmo findIf {(_x select 0) == _magazineClassname}; _magazineIndex = _virtualAmmo findIf {(_x select 0) == _magazineClassname};
if (_magazineIndex == -1) exitWith { if (_magazineIndex == -1) exitWith {
@ -117,7 +117,7 @@ if (_removeAmmoDuringCookoff) then {
if (_newAmmoCount <= 0) then { if (_newAmmoCount <= 0) then {
_virtualAmmo deleteAt _magazineIndex; _virtualAmmo deleteAt _magazineIndex;
} else { } else {
(_virtualAmmo select _magazineIndex) set [1, _newAmmoCount]; // remove ammo that was detonated (_virtualAmmo select _magazineIndex) set [1, _newAmmoCount]; // Remove ammo that was detonated
}; };
}; };
}; };
@ -125,7 +125,7 @@ if (_removeAmmoDuringCookoff) then {
if (_newAmmoCount <= 0) then { if (_newAmmoCount <= 0) then {
_magazines deleteAt _magazineIndex; _magazines deleteAt _magazineIndex;
} else { } else {
_magazine set [1, _newAmmoCount]; // remove ammo that was detonated _magazine set [1, _newAmmoCount]; // Remove ammo that was detonated
}; };
}; };