General > Discussion
Reason for clearing Inv on de-team?
geever:
--- Quote from: xoft on November 15, 2009, 07:05:01 pm ---I'd like to ask if there is any technical or other reason for clearing a soldier's inventory when the soldier is deselected from a ship?
--- End quote ---
There is. Please don't get annoyed but understand coding is not easy. We don't (yet) handle getting out and putting back items to storage on (de-)equipping.
--- Quote from: xoft on November 15, 2009, 07:05:01 pm ---I found the code in client/campaign/cp_aircraft.c that does this (INVSH_DestroyInventory()), commenting the offending line out seems to work at the moment, but I may be mistaken, the catch may not be obvious. Perhaps the saves may become corrupt / items go missing over time / whatever. Can anyone with enough knowledge of the code comment on this?
--- End quote ---
By commenting out that call you've made the item unusable if you unassign and fire your soldier if I'm right. I didn't check it but I'm sure it causes very serious sideeffects.
-geever
xoft:
--- Quote from: geever on November 16, 2009, 03:46:04 pm ---We don't (yet) handle getting out and putting back items to storage on (de-)equipping.
--- End quote ---
That is pretty unbelievable, it seems working at the moment, at least one way - I cannot equip one gun to more soldiers, it goes out of inventory as soon as I use it. I haven't checked whether deequipping the gun puts it back into storage, but somehow I just supposed it would work.
--- Quote from: geever on November 16, 2009, 03:46:04 pm ---By commenting out that call you've made the item unusable if you unassign and fire your soldier if I'm right. I didn't check it but I'm sure it causes very serious sideeffects.
--- End quote ---
Thanks for the insight, didn't think of that. But that is where the code line actually should have been all along - it doesn't make sense to deequip a soldier when he's deassigned from a ship, but it makes perfect sense to deequip him when he's being fired.
geever:
--- Quote from: xoft on November 20, 2009, 12:05:34 pm ---That is pretty unbelievable, it seems working at the moment, at least one way - I cannot equip one gun to more soldiers, it goes out of inventory as soon as I use it. I haven't checked whether deequipping the gun puts it back into storage, but somehow I just supposed it would work.
--- End quote ---
That's a special case, I've fixed things around that in the summer (you could assign a weapon to two soldiers if they were on different ships :) )
Check buy/sell screen. You will see your soldiers weapons/stuff as sellable there - they're in the storage.
--- Quote from: xoft on November 20, 2009, 12:05:34 pm ---Thanks for the insight, didn't think of that. But that is where the code line actually should have been all along - it doesn't make sense to deequip a soldier when he's deassigned from a ship, but it makes perfect sense to deequip him when he's being fired.
--- End quote ---
Of course that's the goal (keep equipment with soldier while hired). But we can't just rush ahead. A little change here breaks several stuff there and so. We're now concentrating on bugfixing of 2.3
-geever
Navigation
[0] Message Index
[*] Previous page
Go to full version