Hey everyone. I'm not exactly new to programming, but I haven't programmed very much in a while, and the last time I did, the best thing I could make was a pong clone. This time I am trying to make a console text-based RPG. After a while I came across a bug and it's been hours and I still can't figure out how to fix it.
The bug is during the battle, when you hit the enemy, it doesn't register the damage in the function that keeps a loop of the battle going. This is a big problem because without it registering the damage, the battle will never end.
Here is some of the code:
These functions are not modifying the enemy you are passing in; they are making a copy and modifying the copy, which is then destroyed when the function ends. Look up passing parameters by reference.