Small fix for 3rd part scripts that use CargoSave on destroyed Vehicles

This commit is contained in:
He-Man 2019-11-14 19:41:57 +01:00
parent d277d6cd57
commit 297b2c0473

View File

@ -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;
};
};
};
};