Sell Icon not updating quantity left


A current issue that is occurring with the build is that when you go to sell an item the count wont correctly change. There's actually two different ways this has been occurring so far. The first way is that the number itself will not track correctly and decrement sporadically and then get stuck at 4. The other way is that the count itself will just go ahead and go into the negatives. Both instances don't allow the player to correctly use the shop and make it to where they can either just sell as many times as they want or not sell enough.

The current thought process on how to fix this current issue is that it seems to be happening due to where the decrement of the count is occurring. Due to the process having to go through a for loop the count itself is getting miscounted at times. However, even if the location of the decrement is more focused to make sure it's only happening once then the count will only go down once. I believe the way to correct this error is to be a bit more precise with the variable and try and do the decrement of the count in a separate function. Perhaps even a event dispatcher would be able to handle this process even better. 



Leave a comment

Log in with itch.io to leave a comment.