Hello there, i have tried to fix this but i do not know where the problem is, okay so, the problem is even though i did not set Lives to decrement in the (Guess.Len() != HiddenWord.Len()) part, still, it decrements the Lives until below zero and it won’t run the EndGame() function like the screenshot i took in UE4, but when i input a word that has the same amount of characters, it ends the program and that’s the behavior that i wanted, can someone help me where the problem is?
I am so so sorry i made this question a bit long… hehe xD
oh yeah, and this happened after the Const Member Functions lecture.
You have --lives and if lives <= 0. So if your code runs again after --lives hits 0 then you get --lives becoming -1. You would have to end the game on 0.
I’m guessing that your EndGame() isn’t actually ending the game. There’s possible other reasons such as if you have --lives somewhere else.