Pt 23: THIEF!!!

1 0 0
                                    

11/26/2023 - One of the bugs that my tested pointed out was that he could purchase weapons he couldn't directly afford yet. So I tested and sure enough, the game just lets you. What happens is that you have a weapon already - go to buy a new one regardless of cost - then when you do, it hides the current one and puts the new one in it's place. You can't shoot it but if you swap weapons and swap back again - its there!

Truth be told, in digging, I found that there was no actual freaking cost check associated with confirming you had enough money, only reducing if you had enough >.> But then fixing that created a new issue!

Essentially, a ghost of a pistol would remain equipped at all times, while it did nothing - graphically it did add the pistol's default laser sight to every weapon (the pistol was small enough to hide in the newly equipped weapon). This only took place because I implemented the secondary small gun that the player character holds that you see in top down. 

Upon looking into this, it turns out... In addition to not checking the player's current currency levels, I also forgot to just delete the currently equipped weapon before instantiating a new one in it's place - this would overwrite the GameObject that held the Pistol (which was the default starting weapon since it is impossible to get anything else, meaning it was always the one that got cloned). Since the GameObject was overwritten, I couldn't delete it via script. 

Anyway, this was a simple enough fix too :)

Zombies and the One Hand Army - Dev LogsWhere stories live. Discover now