Fix lights in multiplayer, fixes #2305

This commit is contained in:
Marianne Gagnon 2015-09-02 18:30:55 -04:00
parent 8a42fab5f1
commit 65a7b5bf04

View File

@ -356,6 +356,7 @@ unsigned IrrDriver::updateLightsInfo(scene::ICameraSceneNode * const camnode,
}
unsigned lightnum = 0;
bool multiplayer = (race_manager->getNumLocalPlayers() > 1);
for (unsigned i = 0; i < 15; i++)
{
@ -373,7 +374,12 @@ unsigned IrrDriver::updateLightsInfo(scene::ICameraSceneNode * const camnode,
float em = light_node->getEnergyMultiplier();
if (em < 1.0f)
{
light_node->setEnergyMultiplier(std::min(1.0f, em + dt));
// In single-player, fade-in lights.
// In multi-player, can't do that, the light objects are shared by all players
if (multiplayer)
light_node->setEnergyMultiplier(1.0f);
else
light_node->setEnergyMultiplier(std::min(1.0f, em + dt));
}
const core::vector3df &pos = light_node->getAbsolutePosition();