Fix #2881, only create a camera when initializing

This commit is contained in:
Benau 2017-07-21 09:27:57 +08:00
parent 1770d01e07
commit 979e1546fb

View File

@ -236,6 +236,14 @@ void World::init()
{
Weather::getInstance<Weather>(); // create Weather instance
}
if((NetworkConfig::get()->isServer() && !ProfileWorld::isNoGraphics()) ||
race_manager->isWatchingReplay())
{
// In case that the server is running with gui or watching replay,
// create a camera and attach it to the first kart.
Camera::createCamera(World::getWorld()->getKart(0));
}
} // init
//-----------------------------------------------------------------------------
@ -300,14 +308,6 @@ void World::reset()
Log::info("World", "Start Recording race.");
ReplayRecorder::get()->init();
}
if((NetworkConfig::get()->isServer() && !ProfileWorld::isNoGraphics()) ||
race_manager->isWatchingReplay())
{
// In case that the server is running with gui or watching replay,
// create a camera and attach it to the first kart.
Camera::createCamera(World::getWorld()->getKart(0));
}
// Reset all data structures that depend on number of karts.
irr_driver->reset();