From b0b5c432542ea5f9292f428bb59e2670c0d7c53d Mon Sep 17 00:00:00 2001 From: Perttu Ahola Date: Sun, 10 Apr 2011 22:50:31 +0300 Subject: better support for old maps --- src/serverobject.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/serverobject.cpp') 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 &messages, bool send_recommended) { assert(m_env); + + const float interval = 0.2; + if(m_move_interval.step(dtime, interval)) + return; + dtime = interval; + core::aabbox3d 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"< &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 &messages, break; } } + + m_is_active = player_is_close; if(player_is_close == false) { -- cgit v1.2.3