diff --git a/server/gameserver/constant.h b/server/gameserver/constant.h index 87ab69d..b611b96 100755 --- a/server/gameserver/constant.h +++ b/server/gameserver/constant.h @@ -231,3 +231,4 @@ const int DEFAULT_BORN_POINT_X = 3000; const int DEFAULT_BORN_POINT_Y = 3000; const int FIXED_OBJECT_MAXID = 1024; +const int VIEW_RANGE = 512; diff --git a/server/gameserver/framemaker.cc b/server/gameserver/framemaker.cc index 1154713..5c21a82 100644 --- a/server/gameserver/framemaker.cc +++ b/server/gameserver/framemaker.cc @@ -35,6 +35,9 @@ cs::SMUpdate* FrameMaker::MakeUpdateMsg(const Human* hum) continue; } } + if (((Human*)hum)->pos.ManhattanDistance(entity->pos) > VIEW_RANGE + 100) { + continue; + } entity->FillMFObjectPart((Human*)hum, msg->add_part_objects()); } for (auto& itr : hum->del_objects) {