From e4daa4c0658dc8547352dd2039ab74d963a48ff0 Mon Sep 17 00:00:00 2001 From: Perttu Ahola Date: Fri, 2 Dec 2011 01:08:14 +0200 Subject: [PATCH] Make players be again visible from a long distance --- src/environment.cpp | 45 ++++++++++++++++++++++++++++----------------- src/player.cpp | 5 +++++ src/player.h | 3 +++ src/serverobject.h | 3 +++ 4 files changed, 39 insertions(+), 17 deletions(-) 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 = "<