Hello,
I have written a function that basically takes in a number and then looks for it in a file, then loads the text beneath does some things and stops when it encounters the next number.
It works perfectly on it's own, but when I put it in my SFML project (you guessed it - it's a game) it never stops and freezes the entire program.
For it to start running first the user has to input some things so when the list of things to do is complete it switches a bool statement to true, and when it does my function that's been waiting inside an if statement can run.
I've tried everything to make it stop after one iteration, but once the program goes into the function it never leaves ignoring my code that literally says - stop it when you load a certain line. Using the debugger I confirmed that it indeed loads that line, but then it just goes back to the start.
Might it be the fault of the main loop of an SFML window?