diff --git a/addons/csw/functions/fnc_reload_handleAddTurretMag.sqf b/addons/csw/functions/fnc_reload_handleAddTurretMag.sqf index e5aa51d342..7e448f81b9 100644 --- a/addons/csw/functions/fnc_reload_handleAddTurretMag.sqf +++ b/addons/csw/functions/fnc_reload_handleAddTurretMag.sqf @@ -39,14 +39,7 @@ if (_canAdd) then { private _currentAmmo = _vehicle magazineTurretAmmo [_loadedMag, _turret]; _currentAmmo = _currentAmmo + _ammoUsed; TRACE_2("Setting mag ammo",_loadedMag,_currentAmmo); - // _vehicle setMagazineTurretAmmo [_loadedMag, _currentAmmo, _turret]; - - // setMagazineTurretAmmo is broken on split locality, use setAmmo for now (this may not work for multi turret vehicles) - private _weapon = (_vehicle weaponsTurret _turret) param [0, ""]; - TRACE_3("setAmmo",_vehicle,_weapon,_currentAmmo); - _vehicle setAmmo [_weapon, _currentAmmo]; - private _currentAmmo = _vehicle magazineTurretAmmo [_loadedMag, _turret]; - if ((_weapon == "") || {_currentAmmo != _currentAmmo}) then { ERROR_1("failed to setAmmo - %1",_this); }; + _vehicle setMagazineTurretAmmo [_loadedMag, _currentAmmo, _turret]; } else { if (_loadedMag != "") then { TRACE_1("Removing emtpy mag",_loadedMag); diff --git a/addons/csw/functions/fnc_reload_handleRemoveTurretMag.sqf b/addons/csw/functions/fnc_reload_handleRemoveTurretMag.sqf index 59d948ba27..118574368c 100644 --- a/addons/csw/functions/fnc_reload_handleRemoveTurretMag.sqf +++ b/addons/csw/functions/fnc_reload_handleRemoveTurretMag.sqf @@ -51,16 +51,7 @@ private _ammoLeft = _ammoInFirstMag - _ammoRemoved; if ((_magsInWeapon isEqualTo []) && {_ammoInFirstMag > _ammoRemoved}) then { // Only one mag in gun, and we're just taking out a partial ammount (unlinking) TRACE_2("Setting mag ammo",_ammoRemoved,_ammoLeft); - // _vehicle setMagazineTurretAmmo [_vehMag, _ammoLeft, _turretPath]; - - // setMagazineTurretAmmo is broken on split locality, use setAmmo for now - private _weapon = (_vehicle weaponsTurret _turretPath) param [0, ""]; - TRACE_3("setAmmo",_vehicle,_weapon,_ammoLeft); - _vehicle setAmmo [_weapon, _ammoLeft]; - private _currentAmmo = _vehicle magazineTurretAmmo [_vehMag, _turretPath]; - if ((_weapon == "") || {_currentAmmo != _ammoLeft}) then { ERROR_1("failed to setAmmo - %1",_this); }; - - + _vehicle setMagazineTurretAmmo [_vehMag, _ammoLeft, _turretPath]; } else { // Because of command limitations, we need to remove mags to change their ammo // This will cause the gun to need to be reloaded if more than one is loaded (only a problem for non-assembly mode guns)