Browse Source

reduce noise for near region when gm regiondebug is on

Emagi 1 year ago
parent
commit
fdb4f2b0ef

+ 19 - 0
EQ2/source/WorldServer/Spawn.cpp

@@ -4470,4 +4470,23 @@ int32 Spawn::InsertRegionToSpawn(Region_Node* node, ZBSP_Node* bsp_root, WaterRe
 	status.lastTimerTic = returnValue ? Timer::GetCurrentTime2() : 0;
 	Regions.insert(make_pair(newMap, status));	
 	return returnValue;
+}
+
+
+bool Spawn::HasRegionTracked(Region_Node* node, ZBSP_Node* bsp_root, bool in_region) {
+	map<map<Region_Node*, ZBSP_Node*>, Region_Status>::iterator testitr;
+	for (testitr = Regions.begin(); testitr != Regions.end(); testitr++)
+	{
+		map<Region_Node*, ZBSP_Node*>::const_iterator actualItr = testitr->first.begin();
+		Region_Node *node = actualItr->first;
+		ZBSP_Node *BSP_Root = actualItr->second;
+		if(node == actualItr->first && BSP_Root == actualItr->second) {
+			if(testitr->second.inRegion == in_region)
+				return true;
+			else
+				break;
+		}
+	}
+	
+	return false;
 }

+ 1 - 0
EQ2/source/WorldServer/Spawn.h

@@ -1288,6 +1288,7 @@ public:
 	
 	
 	int32 InsertRegionToSpawn(Region_Node* node, ZBSP_Node* bsp_root, WaterRegionType regionType, bool in_region = true);
+	bool HasRegionTracked(Region_Node* node, ZBSP_Node* bsp_root, bool in_region);
 	
 	EquipmentItemList equipment_list;
 	EquipmentItemList appearance_equipment_list;

+ 4 - 0
EQ2/source/WorldServer/Zone/region_map_v1.cpp

@@ -295,6 +295,7 @@ void RegionMapV1::MapRegionsNearSpawn(Spawn *spawn, Client *client) const
 			}	
 			continue;
 		}
+		
 		float x1 = node->x - testLoc.x;
 		float y1 = node->y - testLoc.y;
 		float z1 = node->z - testLoc.z;
@@ -321,6 +322,9 @@ void RegionMapV1::MapRegionsNearSpawn(Spawn *spawn, Client *client) const
 			}
 			else
 			{
+				if(spawn->HasRegionTracked(node, BSP_Root, false)) {
+					continue;
+				} // UpdateRegionsNearSpawn will capture it for nodes that have BSP_Root's
 				if (spawn->InRegion(node, BSP_Root))
 				{
 					if (client)