瀏覽代碼

Fixed grid id in houses for objects

In support of issue #124
Image 4 年之前
父節點
當前提交
8ab1e3135c
共有 2 個文件被更改,包括 7 次插入0 次删除
  1. 6 0
      EQ2/source/WorldServer/WorldDatabase.cpp
  2. 1 0
      EQ2/source/WorldServer/client.cpp

+ 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);