Function doesn't work...?

I have a function which generates a random map for a game, but it just makes the game not respond at all.

This is the part which calls the function:
1
2
3
debug << "calling generatemap()" << std::endl;
GenerateMap();
debug << "generatemap() complete" << std::endl;


And the function:
1
2
3
4
5
void GenerateMap() {
  debug << "GenerateMap() begin" << std::endl;
  *lots of code*
  debug << "Map generated!" << std::endl;
}


The debug log shows nothing but calling generatemap(). Looks like it calls the function, but hangs right after that. :/
So maybe you should show us the code? Put more debug << s to see where exactly does it hang.
There is nothing between "calling generatemap()" and "GenerateMap() begin" except the function call, and the latter message does not appear in the log, so it hangs right there.
Last edited on
By the way the problems appeared when I wrote a new mapgen (the old one was too complex for me, so I decided to make a simpler one) and moved it to a separate file. It still doesn't work if I have it all in the same file though.
Why don't you just post the code - your posts aren't exactly helpful and we would jsut be stabbing around in the dark.

P.S - Are you using any dynamic allocation in the map generation code.
Last edited on
Managed to get it to work - I was trying to change a variable with ==.
Last edited on
Topic archived. No new replies allowed.