Omni_Fluxx
(Omni_Fluxx)
January 11, 2025, 5:16am
1
Okay i have this weird bug in which the items at first glance work as intended. my items list as training sword x3 properly, but that’s if i collect three IN A ROW.
But here’s what happens when I collect two different items then collect two more of the first item collected.
each item is now listed separately as opposed to increasing the quantity. Arrays are still weird to me so if someone can help out i appreciate it!
here’s my logic for adding items into the inventory:
Sorry for the lengthy question.
Auran131
(Auran13)
January 11, 2025, 5:33am
2
Your ItemAlreadyInInventory is failing.
the return node breaks the loop so its only checking the first value, put a branch before it and only return if true.
a few other efficiencies you can do
Use SetMembersInStruct rather than copying all the values
you can get the StructRef and not even have to SetArrayElement
2 Likes
Omni_Fluxx
(Omni_Fluxx)
January 11, 2025, 6:29pm
3
Thanks! I’m dumbfounded that one simple branch node impacts that code, I also appreciate you explaining what’s happening! I’m still learning!
1 Like