ソースを参照

Fixed grid id in houses for objects

In support of issue #124
Image 4 年 前
コミット
8ab1e3135c

+ 6 - 0
EQ2/source/WorldServer/WorldDatabase.cpp

@@ -6716,6 +6716,12 @@ void WorldDatabase::GetHouseSpawnInstanceData(ZoneServer* zone, Spawn* spawn)
 	if (result.GetNumRows() > 0 && result.Next()) {
 		spawn->SetPickupItemID(result.GetInt32(0));
 		spawn->SetPickupUniqueItemID(result.GetInt32(1));
+
+		if (spawn->GetZone() != nullptr && spawn->GetZone()->zonemap != nullptr && spawn->GetZone()->zonemap->IsMapLoaded())
+		{
+			int32 newGrid = spawn->GetZone()->Grid->GetGridID(spawn);
+			spawn->SetPos(&(spawn->appearance.pos.grid_id), newGrid);
+		}
 	}
 }
 

+ 1 - 0
EQ2/source/WorldServer/client.cpp

@@ -8715,6 +8715,7 @@ bool Client::PopulateHouseSpawn(PacketStruct* place_object)
 		tmp->SetSpawnOrigY(tmp->GetY());
 		tmp->SetSpawnOrigZ(tmp->GetZ());
 		tmp->SetSpawnOrigHeading(tmp->GetHeading());
+		
 		database.SaveSpawnInfo(tmp);
 		database.SaveSpawnEntry(tmp, "houseplacement", 100, 0, 0, 0);