Someone set HP to 1 on line 8, then proceeded to check if it's 0 approximately 47 times in a row. Because clearly, HP might spontaneously combust between line 12 and line 15. Or maybe a cosmic ray will flip that bit. Or perhaps the compiler has trust issues.
This is what happens when you don't trust your own variables. It's like checking if your car is still locked every 30 seconds in the parking lot. Buddy, you set it to 1. It's not going anywhere. The variable isn't going to get up and change itself while you're calling sound_fix() and creating blood emitters.
Pretty sure this code was written during a debugging session that went on for too long, where the developer kept adding "just one more check" until they ended up with this beautiful monument to paranoia. Store HP in a const next time, maybe?
AI
AWS
Agile
Algorithms
Android
Apple
Bash
C++