mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Simplistic wielded tool lighting, added setMeshVerticesColor to utility.h and refactored some other code into calls of that
This commit is contained in:
parent
a4a2c34831
commit
3e012122d1
8 changed files with 66 additions and 145 deletions
|
@ -1686,18 +1686,19 @@ void ClientEnvironment::step(float dtime)
|
|||
// Move
|
||||
player->move(dtime, *m_map, 100*BS);
|
||||
|
||||
// Update lighting on remote players on client
|
||||
u8 light = LIGHT_MAX;
|
||||
try{
|
||||
// Get node at head
|
||||
v3s16 p = player->getLightPosition();
|
||||
MapNode n = m_map->getNode(p);
|
||||
light = n.getLightBlend(getDayNightRatio());
|
||||
}
|
||||
catch(InvalidPositionException &e) {}
|
||||
player->updateLight(light);
|
||||
}
|
||||
|
||||
// Update lighting on all players on client
|
||||
u8 light = LIGHT_MAX;
|
||||
try{
|
||||
// Get node at head
|
||||
v3s16 p = player->getLightPosition();
|
||||
MapNode n = m_map->getNode(p);
|
||||
light = n.getLightBlend(getDayNightRatio());
|
||||
}
|
||||
catch(InvalidPositionException &e) {}
|
||||
player->updateLight(light);
|
||||
|
||||
/*
|
||||
Add footsteps to grass
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue