move PlayerEntity calculateCurrentCargo into ShipEntity and change it to return current_cargo
change ShipEntity scoopUp line 6316 from
Code: Select all
if ([cargo count] == max_cargo) [shipAI message:@"HOLD_FULL"];
Code: Select all
if ([self calculateCurrentCargo] >= max_cargo) [shipAI message:@"HOLD_FULL"];
I think this will sort out some weird behavour that I have seen, such as getting a hold full if my cobra has 34t and I scoop 10kg of gold.
Also, I think it is possible to construct in an oxp, a cargo canister with, say 2t of commodity in. If you scoop that, we will go past max_cargo, and I think some seriously weird things may happen. I guess that we should issue a holds full if cargo == max_cargo, and if it is greater, to immediately dump whatever we just scooped, so that we never go above max.
This could be a start down the road to fixing bug 12373 maybe change PlayerEntityLegacyScriptEngine useSpecialCargo to fill the hold with cargo type="special" or something like that, a non tradable commodity?