Skip to content

Commit

Permalink
Small fix for 3rd part scripts that use CargoSave on destroyed Vehicles
Browse files Browse the repository at this point in the history
  • Loading branch information
Ignatz-HeMan committed Nov 14, 2019
1 parent d277d6c commit 297b2c0
Showing 1 changed file with 14 additions and 2 deletions.
Expand Up @@ -80,10 +80,22 @@ params [["_vehicle",objnull],["_items",[]]];
case 4: {
_type = _x select 0;
_subContainers = (everycontainer _vehicle) select {(_x select 0) isequalto _type && magazinesAmmoCargo (_x select 1) isequalto [] && weaponsItemsCargo (_x select 1) isequalto []};
if !(_subContainers isequalto [])
then {
if !(_subContainers isequalto []) then {
_subContainer = _subContainers select 0 select 1;
[_subContainer,_x select 1] call EPOCH_server_CargoFill;
}
else {
if (_type isKindOf "Bag_Base") then {
_vehicle addBackpackCargoGlobal [_type, 1];
}
else {
_vehicle addItemCargoGlobal [_type, 1];
};
_subContainers = (everycontainer _vehicle) select {(_x select 0) isequalto _type && magazinesAmmoCargo (_x select 1) isequalto [] && weaponsItemsCargo (_x select 1) isequalto []};
if !(_subContainers isequalto []) then {
_subContainer = _subContainers select 0 select 1;
[_subContainer,_x select 1] call EPOCH_server_CargoFill;
};
};
};
};
Expand Down

0 comments on commit 297b2c0

Please sign in to comment.