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();
}