Player reload bug

 Author: Daniel Jackson

    While balancing enemies and bosses I discovered that the player had the chance to lose entire magazines of ammo when using the auto reload function that occurs when the equipped weapon's current magazine runs out of ammo. Additionally, the ammo in the current magazine could drop into negative values which was a very clear issue.

    The first change I made was an executive design decision that the player would only auto-reload when they pressed fire and had no ammo rather than immediately starting a reload when they hit zero current ammo. Then I discovered an issue inside the reload function that was miscalculating the amount of ammo needed to refill the magazine and found that reload was being called an extra time causing the extra drop in ammo. Finally, I added a check that will prevent any possibility of firing when out of ammo and prevents the current ammo count from ever dropping below zero which solved the display error and the miscalculations.

Comments

Popular posts from this blog

Adding assets to every enemy -- Owen Meyers

Sphere to AABB collision