From: Perttu Ahola Date: Thu, 1 Dec 2011 23:08:14 +0000 (+0200) Subject: Make players be again visible from a long distance X-Git-Url: http://81.2.79.47:8989/gitweb/?a=commitdiff_plain;h=e4daa4c0658dc8547352dd2039ab74d963a48ff0;p=zefram%2Fminetest%2Fminetest_engine.git Make players be again visible from a long distance --- diff --git a/src/environment.cpp b/src/environment.cpp index 17c9ecff..e8dfebcb 100644 --- a/src/environment.cpp +++ b/src/environment.cpp @@ -1217,10 +1217,12 @@ void ServerEnvironment::getAddedActiveObjects(v3s16 pos, s16 radius, // Discard if removed if(object->m_removed) continue; - // Discard if too far - f32 distance_f = object->getBasePosition().getDistanceFrom(pos_f); - if(distance_f > radius_f) - continue; + if(object->unlimitedTransferDistance() == false){ + // Discard if too far + f32 distance_f = object->getBasePosition().getDistanceFrom(pos_f); + if(distance_f > radius_f) + continue; + } // Discard if already on current_objects core::map::Node *n; n = current_objects.find(id); @@ -1255,24 +1257,33 @@ void ServerEnvironment::getRemovedActiveObjects(v3s16 pos, s16 radius, { u16 id = i.getNode()->getKey(); ServerActiveObject *object = getActiveObject(id); - if(object == NULL) - { + + if(object == NULL){ infostream<<"ServerEnvironment::getRemovedActiveObjects():" <<" object in current_objects is NULL"<m_removed == false) + + if(object->m_removed) { - f32 distance_f = object->getBasePosition().getDistanceFrom(pos_f); - /*infostream<<"removed == false" - <<"distance_f = "<