Fix lights in multiplayer, fixes #2305
This commit is contained in:
parent
8a42fab5f1
commit
65a7b5bf04
@ -356,6 +356,7 @@ unsigned IrrDriver::updateLightsInfo(scene::ICameraSceneNode * const camnode,
|
|||||||
}
|
}
|
||||||
|
|
||||||
unsigned lightnum = 0;
|
unsigned lightnum = 0;
|
||||||
|
bool multiplayer = (race_manager->getNumLocalPlayers() > 1);
|
||||||
|
|
||||||
for (unsigned i = 0; i < 15; i++)
|
for (unsigned i = 0; i < 15; i++)
|
||||||
{
|
{
|
||||||
@ -373,6 +374,11 @@ unsigned IrrDriver::updateLightsInfo(scene::ICameraSceneNode * const camnode,
|
|||||||
float em = light_node->getEnergyMultiplier();
|
float em = light_node->getEnergyMultiplier();
|
||||||
if (em < 1.0f)
|
if (em < 1.0f)
|
||||||
{
|
{
|
||||||
|
// 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));
|
light_node->setEnergyMultiplier(std::min(1.0f, em + dt));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user