mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
fixed a possible infinite loop in ClientEnvironment (dtime counter getting so small that it doesn't increment the value)
This commit is contained in:
parent
9f859d8389
commit
ec3cb2d1d7
2 changed files with 11 additions and 2 deletions
|
@ -808,10 +808,20 @@ void ClientEnvironment::step(float dtime)
|
|||
|
||||
f32 dtime_part;
|
||||
if(dtime_downcount > dtime_max_increment)
|
||||
{
|
||||
dtime_part = dtime_max_increment;
|
||||
dtime_downcount -= dtime_part;
|
||||
}
|
||||
else
|
||||
{
|
||||
dtime_part = dtime_downcount;
|
||||
dtime_downcount -= dtime_part;
|
||||
/*
|
||||
Setting this to 0 (no -=dtime_part) disables an infinite loop
|
||||
when dtime_part is so small that dtime_downcount -= dtime_part
|
||||
does nothing
|
||||
*/
|
||||
dtime_downcount = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
Handle local player
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue