Skip to content
Snippets Groups Projects
Commit 65b2a2cb authored by Perttu Ahola's avatar Perttu Ahola
Browse files

Make lighting update occur immediately after ClientActiveObject addition to...

Make lighting update occur immediately after ClientActiveObject addition to make objects show up much more responsively
parent 70363847
No related branches found
No related tags found
No related merge requests found
......@@ -2289,8 +2289,18 @@ u16 ClientEnvironment::addActiveObject(ClientActiveObject *object)
infostream<<"ClientEnvironment::addActiveObject(): "
<<"added (id="<<object->getId()<<")"<<std::endl;
m_active_objects.insert(object->getId(), object);
// TODO: Make g_texturesource non-global
object->addToScene(m_smgr, m_texturesource);
{ // Update lighting immediately
u8 light = 0;
try{
// Get node at head
v3s16 p = object->getLightPosition();
MapNode n = m_map->getNode(p);
light = n.getLightBlend(getDayNightRatio(), m_gamedef->ndef());
}
catch(InvalidPositionException &e) {}
object->updateLight(light);
}
return object->getId();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment