I'm getting errors in my program between two (theoretically) consecutive lines of code, and have no idea what could cause this.
My whole code is huge, so here's the basics;
int playRoom(std::string currentRoom = "Storage_room", std::string entryDoor = "NULL"){
log("Starting playRoom()");
// code to play the level
// includes setting up box2d world
// and playing the level
if(playerWantsRestart){
log("Restart level");
return playRoom(savedData.roomName, savedData.entryDoor);
}
log("Leaving playRoom()");
return 0;
}
int main( int argc, char* args[] ){
// Set up SDL etc..
playRoom();
log("Back in main()");
// Close SDL
return 0;
}
If I never use the restart option, everything is fine. If I do use it, the program exits with status 3 and the log file reads:
Starting playRoom()
Restart level
Starting playRoom()
Leaving playRoom()
So the error appears to be in "return 0;"?? I don't think status 3 is an overflow, and it's only recursed (?) once anyway, so... I'm using Codeblocks 12.11, compiling with GNU GCC. Any help or ideas would be great!