It's happening around my game a lot it seems, as an example. I have a function where you can trade creature skins for money, the UI tells you how many skins you have remaining (all this works fine). When you have enough money/skins it will give you the item but also play a sound effect, if you don't have enough money/skins it won't give you anything and play an error sound.
The problem is, if the player has just 1 creature skin the system reads they have at least 1 and trades it for money. At the same, it seems that because it reads how many creature skins I have it also reads that I have 0 because the purchase function is taking one off me when I do have one. This then too plays the error sound, so basically whenever I have one of something left and purchase something taking the count to 0 it plays both the purchase sound effect and error sound effect.
Any help would be greatly appreciated.