Closed cbcerquiaga closed 5 years ago
Yes, the issue likely has to do with a delay of deactivation of the dropped item and the in game ticks.
Added an instance variable to each item so that it can detect if it has already been picked up. Then re-enables it when dropped. This has fixed the issue.
It looks like it's multiplying item counts, not adding or showing a random number. I was working on dropping items from the menu, and so I picked up the coins and tried to drop them from the menu. The console read:
Added 5 Coin to p1's inventory Added 10 Coin to p1's inventory Added 20 Coin to p1's inventory Added 40 Coin to p1's inventory inventory loaded quests: [] weapons: [] equippables: [] consumables: [] misc: [[StaticBody2D:1519]] discovered places: [] Added 80 Coin to p1's inventory Added 160 Coin to p1's inventory Added 320 Coin to p1's inventory Added 640 Coin to p1's inventory misc item Added 1280 Coin to p1's inventory Added 2560 Coin to p1's inventory Added 5120 Coin to p1's inventory emit signal 2
"emit signal 2" is from the inventoryOptionPopup, so that's not relevant here. It looks like it's just continuously multiplying the 5 coins by 2- maybe every cycle that the action button was pressed.