When there is plenty of equipment, moving a soldier onto the craft will move their equipment with them, and moving them off the craft moves their equipment off too - leaving exactly the same 'extra' equipment on the craft as when you first started. That's good. But if there is not enough items in the base for both the soldier's equipment and the extra equipment, it's different. The soldier claims ownership of the equipment so that they can complete their loadout; and so when they leave the craft they take the equipment with them.
Yes, if there is not enough items, somebody has to claim it, either the soldier or the craft. There is no third option.
For example, suppose you have 2 laser rifles available in your base and you want to bring them on every mission, so you assign them as 'extra' equipment on the craft. If you then equip the laser rifles in your soldiers' loadouts, those laser rifles will be taken off the craft when the soldiers are swapped out. This probably isn't what you want.
For me, the clear winner in this case must be the soldier, not the craft.
That was the defining requirement of this whole feature.
So yes, it is exactly what I want.
Otherwise I cannot trust this feature to keep my equipment on my soldiers, they will randomly start losing it... which I definitely don't want.
What I'd like is for the craft to remember the extra equipment assigned, so that when soldiers leave the craft, that amount of extra equipment remains unchanged - even if it was used in some soldiers loadout. As for how to implement it... my immediate idea involves heaps of changes - which I'd probably just go ahead and do if it was my project; but I suspect you'd be relucted to accept the changes. You might prefer it to be done in a different way.
Before we go into how much rewrite I'm willing to accept... how would this even be done GUI-wise?
Do you add a new GUI or a new set of left/right arrows to allow player to define this "extra" equipment? (the current left/right arrows need to stay to define the total equipment on the craft)
And how would it look like when I have 6 rifles on the soldiers, 2 extra rifles and 20 rifles together on the craft? 6/2/20? Or 6/8/20? Or 6/+2/+14?
How will it look like when I have 6 rifles on soldiers, 2 extra but only 7 together on the craft?
What about if I have only 3 rifles in total in the craft?
Isn't having up to 3 numbers next to each item just too much? (not to mention not enough space on the GUI)
And how would this work together with the loading/saving of craft equipment via F5/F9?
(And of course my feedback to previous statement also applies here. I'd definitely want the game to take away from the "extra", not from the soldier's loadout.)
Here's an outline of what I have in mind: the craft's `_tempSoldierItems` list that is currently used for soldier equipment should be replaced with `_extraCraftItems` to store the extras list instead of the in-use list. I figure that the total soldiers' equipment can be calculated at any time, and so we don't really need to store it. Whereas the extra items is not always inferrable; it must be recorded if we want to remember it. `calculateTotalSoldierEquipment` would remain, because it is useful - but instead of storing the results in a member variable, it would simply return the entire vector. The calling function can store that vector for however long it needs it. (Returning a vector in C++ was once a bad thing to do, for efficiency reasons. But that's no longer an issue, thanks to the magic of `std::move`.)
We can just use both, temp soldier items and extra items.
Btw. `_tempSoldierItems` is not persisted even today. It's just a helper variable.
Anyway, that would be a significant amount of stuffing around with the API of the new code, but the logic is pretty much unchanged. Currently (without these API changes) we have total equipment on the craft, and a calculated list of what the soldiers are using; and we use `extras = total - used` to work out the leftovers. The problem is that the leftovers may only be a subset of what we want to reserve to stay on the craft.
Here we would need input from the players and people who requested this feature originally.
You will always have one of the 2 problems:
1. if there is not enough items in total, there won't be enough "extra"
2. if there is not enough items in total, there won't be enough for the soldiers
For me (as a player), #2 is not acceptable.