mirror of
https://github.com/minetest/minetest.git
synced 2024-11-27 01:53:45 +01:00
fixed the object update interval thingy
This commit is contained in:
parent
9d5ccafbb0
commit
bb39795ab2
@ -380,6 +380,8 @@ void ServerEnvironment::deSerializePlayers(const std::string &savedir)
|
|||||||
void ServerEnvironment::step(float dtime)
|
void ServerEnvironment::step(float dtime)
|
||||||
{
|
{
|
||||||
DSTACK(__FUNCTION_NAME);
|
DSTACK(__FUNCTION_NAME);
|
||||||
|
|
||||||
|
//TimeTaker timer("ServerEnv step");
|
||||||
|
|
||||||
// Get some settings
|
// Get some settings
|
||||||
//bool free_move = g_settings.getBool("free_move");
|
//bool free_move = g_settings.getBool("free_move");
|
||||||
@ -451,6 +453,8 @@ void ServerEnvironment::step(float dtime)
|
|||||||
|
|
||||||
if(m_object_management_interval.step(dtime, 0.5))
|
if(m_object_management_interval.step(dtime, 0.5))
|
||||||
{
|
{
|
||||||
|
//TimeTaker timer("ServerEnv object management");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Remove objects that satisfy (m_removed && m_known_by_count==0)
|
Remove objects that satisfy (m_removed && m_known_by_count==0)
|
||||||
*/
|
*/
|
||||||
|
@ -172,7 +172,7 @@ void ItemSAO::step(float dtime, Queue<ActiveObjectMessage> &messages,
|
|||||||
assert(m_env);
|
assert(m_env);
|
||||||
|
|
||||||
const float interval = 0.2;
|
const float interval = 0.2;
|
||||||
if(m_move_interval.step(dtime, interval))
|
if(m_move_interval.step(dtime, interval)==false)
|
||||||
return;
|
return;
|
||||||
dtime = interval;
|
dtime = interval;
|
||||||
|
|
||||||
@ -312,7 +312,7 @@ void RatSAO::step(float dtime, Queue<ActiveObjectMessage> &messages,
|
|||||||
|
|
||||||
if(m_is_active == false)
|
if(m_is_active == false)
|
||||||
{
|
{
|
||||||
if(m_inactive_interval.step(dtime, 0.5))
|
if(m_inactive_interval.step(dtime, 0.5)==false)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2033,12 +2033,9 @@ public:
|
|||||||
{
|
{
|
||||||
m_accumulator += dtime;
|
m_accumulator += dtime;
|
||||||
if(m_accumulator < wanted_interval)
|
if(m_accumulator < wanted_interval)
|
||||||
{
|
return false;
|
||||||
dtime = 0;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
m_accumulator -= wanted_interval;
|
m_accumulator -= wanted_interval;
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
protected:
|
protected:
|
||||||
float m_accumulator;
|
float m_accumulator;
|
||||||
|
Loading…
Reference in New Issue
Block a user