title: Creating an object in another class's function causing loop?
body: <p>I am using c++ and the Irrlicht engine to create a game for a university project, and I've run into a problem.</p>
  
  <p>I have a class called World, that sets up the engine and loads in the map, and the Main class creates an object of this class, and the constructor is called creating the world and setting up the engine (This all works fine!). </p>
  
  <p>However, now I have created a Player class that will set up the camera. The code I have to set up the camera works <i><strong>fine</strong></i> if it is in the same class as <code>World</code>: if I create a function in the class <code>World</code> and call that function in the constructor, all is well. However, whenever I put this code into the <code>Player</code> class, and then create an object of Player in the <code>World</code> constructor, it causes an infinite loop of the constructor for the class <code>World</code>.</p>
  
  <p>I don't want to stick all the function in the class <code>World</code>, as splitting it up would be a lot neater!</p>
  
  <p>World.cpp &amp; World.h = <a href="http://pastebin.com/qtTsGQAR" rel="nofollow">http://pastebin.com/qtTsGQAR</a> </p>
  
  <p>Player.cpp &amp; World.h = <a href="http://pastebin.com/DR7aUiYf" rel="nofollow">http://pastebin.com/DR7aUiYf</a></p>