Fix #2881, only create a camera when initializing
This commit is contained in:
parent
1770d01e07
commit
979e1546fb
@ -236,6 +236,14 @@ void World::init()
|
|||||||
{
|
{
|
||||||
Weather::getInstance<Weather>(); // create Weather instance
|
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
|
} // init
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
@ -300,14 +308,6 @@ void World::reset()
|
|||||||
Log::info("World", "Start Recording race.");
|
Log::info("World", "Start Recording race.");
|
||||||
ReplayRecorder::get()->init();
|
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.
|
// Reset all data structures that depend on number of karts.
|
||||||
irr_driver->reset();
|
irr_driver->reset();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user