Fix safe coins refund when packing

The check will always return 'false' because packedClass is a Weapon Holder (classname: WeaponHolder_xxx) and those aren't in DZE_MoneyStorageClasses.
And there's no need for that check anyway because the _isZSC variable checks if it's a money storage.
This commit is contained in:
Luka
2021-11-26 13:29:13 +01:00
committed by GitHub
parent 77b27f6cbf
commit 9f8af554d4

View File

@@ -118,7 +118,7 @@ call {
_weapons = getWeaponCargo _obj; _weapons = getWeaponCargo _obj;
_magazines = getMagazineCargo _obj; _magazines = getMagazineCargo _obj;
_backpacks = getBackpackCargo _obj; _backpacks = getBackpackCargo _obj;
if (_isZSC && {_packedClass in DZE_MoneyStorageClasses}) then {_coins = _obj getVariable ["cashMoney",0];}; if (_isZSC) then {_coins = _obj getVariable ["cashMoney",0];};
_holder = _packedClass createVehicle [0,0,0]; _holder = _packedClass createVehicle [0,0,0];
deleteVehicle _obj; deleteVehicle _obj;
@@ -126,7 +126,7 @@ call {
_holder setPosATL _pos; _holder setPosATL _pos;
_holder addMagazineCargoGlobal [getText(configFile >> "CfgVehicles" >> _packedClass >> "seedItem"),1]; _holder addMagazineCargoGlobal [getText(configFile >> "CfgVehicles" >> _packedClass >> "seedItem"),1];
[_weapons,_magazines,_backpacks,_holder] call fn_addCargo; [_weapons,_magazines,_backpacks,_holder] call fn_addCargo;
if (_isZSC && {_packedClass in DZE_MoneyStorageClasses && {_coins > 0}}) then { if (_isZSC && {_coins > 0}) then {
private "_displayName"; private "_displayName";
_displayName = getText (configFile >> "CfgVehicles" >> _type >> "displayName"); _displayName = getText (configFile >> "CfgVehicles" >> _type >> "displayName");
@@ -172,4 +172,4 @@ diag_log _message;
if (_status < 3) then { if (_status < 3) then {
dze_waiting = "success"; dze_waiting = "success";
_clientID publicVariableClient "dze_waiting"; _clientID publicVariableClient "dze_waiting";
}; };