diff options
author | Perttu Ahola <celeron55@gmail.com> | 2011-04-10 22:50:31 +0300 |
---|---|---|
committer | Perttu Ahola <celeron55@gmail.com> | 2011-04-10 22:50:31 +0300 |
commit | b0b5c432542ea5f9292f428bb59e2670c0d7c53d (patch) | |
tree | 60b280856a266c0bebef81a79cd5c2e72dcb50af /src/serverobject.cpp | |
parent | 3d25fe42f34589bd10a92929c442c2cd7f607309 (diff) | |
download | minetest-b0b5c432542ea5f9292f428bb59e2670c0d7c53d.tar.gz minetest-b0b5c432542ea5f9292f428bb59e2670c0d7c53d.tar.bz2 minetest-b0b5c432542ea5f9292f428bb59e2670c0d7c53d.zip |
better support for old maps
Diffstat (limited to 'src/serverobject.cpp')
-rw-r--r-- | src/serverobject.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/serverobject.cpp b/src/serverobject.cpp index a58ca524d..b6015a477 100644 --- a/src/serverobject.cpp +++ b/src/serverobject.cpp @@ -170,6 +170,12 @@ void ItemSAO::step(float dtime, Queue<ActiveObjectMessage> &messages, bool send_recommended) { assert(m_env); + + const float interval = 0.2; + if(m_move_interval.step(dtime, interval)) + return; + dtime = interval; + core::aabbox3d<f32> box(-BS/3.,0.0,-BS/3., BS/3.,BS*2./3.,BS/3.); collisionMoveResult moveresult; // Apply gravity @@ -270,6 +276,7 @@ RatSAO proto_RatSAO(NULL, 0, v3f(0,0,0)); RatSAO::RatSAO(ServerEnvironment *env, u16 id, v3f pos): ServerActiveObject(env, id, pos), + m_is_active(false), m_speed_f(0,0,0) { //dstream<<"Server: RatSAO created"<<std::endl; @@ -303,6 +310,12 @@ void RatSAO::step(float dtime, Queue<ActiveObjectMessage> &messages, { assert(m_env); + if(m_is_active == false) + { + if(m_inactive_interval.step(dtime, 0.5)) + return; + } + /* The AI */ @@ -336,6 +349,8 @@ void RatSAO::step(float dtime, Queue<ActiveObjectMessage> &messages, break; } } + + m_is_active = player_is_close; if(player_is_close == false) { |