1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-09-30 19:22:14 +00:00

Give more infos to on_timer() callback

closes #15817
This commit is contained in:
sfan5 2025-08-10 17:22:06 +02:00
parent 7c88996210
commit fd3588d49c
8 changed files with 31 additions and 21 deletions

View file

@ -572,8 +572,8 @@ void ServerEnvironment::activateBlock(MapBlock *block)
return;
// Run node timers
block->step((float)dtime_s, [&](v3s16 p, MapNode n, f32 d) -> bool {
return m_script->node_on_timer(p, n, d);
block->step((float)dtime_s, [&](v3s16 p, MapNode n, NodeTimer t) -> bool {
return m_script->node_on_timer(p, n, t.elapsed, t.timeout);
});
}
@ -999,8 +999,8 @@ void ServerEnvironment::step(float dtime)
}
// Run node timers
block->step(dtime, [&](v3s16 p, MapNode n, f32 d) -> bool {
return m_script->node_on_timer(p, n, d);
block->step(dtime, [&](v3s16 p, MapNode n, NodeTimer t) -> bool {
return m_script->node_on_timer(p, n, t.elapsed, t.timeout);
});
}
}