CSW - Fix loading with ammo from vehicle cargo (#8995)

Co-authored-by: GhostIsSpooky <LinkIsParking@hotmail.com>
This commit is contained in:
GhostIsSpooky 2022-08-14 13:09:01 -03:00 committed by GitHub
parent b47b8014e7
commit 4943b2119d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 9 deletions

View File

@ -72,7 +72,7 @@ private _bestAmmoToSend = -1;
_bestAmmoToSend = _xAmmo; _bestAmmoToSend = _xAmmo;
}; };
}; };
} forEach (if (_reloadSource isKindOf "CaManBase") then {magazinesAmmo _reloadSource} else {magazinesAmmoCargo _reloadSource}); } forEach (if (_reloadSource isKindOf "CAManBase") then {magazinesAmmo _reloadSource} else {magazinesAmmoCargo _reloadSource});
TRACE_4("",_reloadSource,_reloadMag,_reloadNeededAmmo,_bestAmmoToSend); TRACE_4("",_reloadSource,_reloadMag,_reloadNeededAmmo,_bestAmmoToSend);
if (_bestAmmoToSend == -1) exitWith {ERROR("No ammo");}; if (_bestAmmoToSend == -1) exitWith {ERROR("No ammo");};

View File

@ -45,7 +45,7 @@ private _onFinish = {
_bestAmmoToSend = _xAmmo; _bestAmmoToSend = _xAmmo;
}; };
}; };
} forEach (magazinesAmmo _magSource); } forEach (if (_magSource isKindOf "CAManBase") then {magazinesAmmo _magSource} else {magazinesAmmoCargo _magSource});
if (_bestAmmoToSend == -1) exitWith {ERROR_2("No ammo [%1 - %2]?",_xMag,_bestAmmoToSend);}; if (_bestAmmoToSend == -1) exitWith {ERROR_2("No ammo [%1 - %2]?",_xMag,_bestAmmoToSend);};
[_magSource, _carryMag, _bestAmmoToSend] call EFUNC(common,removeSpecificMagazine); [_magSource, _carryMag, _bestAmmoToSend] call EFUNC(common,removeSpecificMagazine);
@ -57,11 +57,11 @@ private _onFinish = {
[ [
TIME_PROGRESSBAR(_timeToLoad), TIME_PROGRESSBAR(_timeToLoad),
[_vehicle, _turret, _carryMag, _magSource], [_vehicle, _turret, _carryMag, _magSource],
_onFinish, _onFinish,
{TRACE_1("load progressBar fail",_this);}, {TRACE_1("load progressBar fail",_this);},
_displayName, _displayName,
{((_this select 0) call FUNC(reload_canLoadMagazine)) select 0}, {((_this select 0) call FUNC(reload_canLoadMagazine)) select 0},
["isNotInside"] ["isNotInside"]
] call EFUNC(common,progressBar); ] call EFUNC(common,progressBar);