Preserve inventory order when AI switches weapons#222
Preserve inventory order when AI switches weapons#222Causeless merged 8 commits intocortex-command-community:developmentfrom
Conversation
This prevents AIs from messing up the inventory order whenever a player switches away from a unit while holding a tool or something. This has been bugging me for months.
|
...oh wait, there's also EquipNamedDevice that has the exact same code verbatim except for a different target it looks for. Just a minute, let me apply change to it too... |
|
Decided to properly check after a bunker breach session....There are 5 more times code like this is duplicated in this file. aAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA |
|
...oh hold on there's now a crash when GetMass() enumerates mass of inventory items oops, lemme fix lmao |
Forgot to put this down in the various places oops lmao
gkljoiwjegoiwjoiuhbjfslkhgjwrpeso
|
I needed to just, record a video showing the inventory staying consistent despite the AI switching the inventory multiple times and equipping shields and stuff. The relief that I can just switch from a character in the middle of digging a tunnel to check up on another one, then come back and have the inventory ordered exactly as it was, is palpable. wasd.mp4 |
|
WAIT DON'T MERGE YET, i just discovered one more slight issue here 😭😭😭😭😭😭😭 The new code, when it finds an item at Suboptimal! Had this crash exactly once a few days ago and couldn't find the issue until now lol Gimme a few minutes to figure out and push a fix. |
odksjhgvsdhgkjsdhghdsafoieh
Head branch was pushed to by a user without write access
|
all good now 👍 |
|
*stares in awe and incomprehension at the scary C pointer magics* |
|
@Architector4 Are you on the Discord by any chance? Really nice to see your contributions! |
I do have Discord, but I'm not active there at all. I do have a Telegram though that I'm active on lol |
This prevents AIs from messing up the inventory order whenever a player switches away from a unit while holding a tool or something.
This has been bugging me for months.