Core/GameObjects: validate gameobject rotation on startup

This commit is contained in:
Ovahlord committed 2022-10-20 19:44:53 +02:00
1 parent 181d1e2485
commit cd7eef7945
1 file changed
+6
+6
View File
@@ -2536,6 +2536,12 @@ void ObjectMgr::LoadGameObjects()
continue;
}
if (!data.rotation.isUnit())
{
TC_LOG_ERROR("sql.sql", "Table `gameobject` has gameobject (GUID: %u Entry: %u) with invalid rotation quaternion (non-unit), defaulting to orientation on Z axis only", guid, data.id);
data.rotation = QuaternionData::fromEulerAnglesZYX(data.spawnPoint.GetOrientation(), 0.0f, 0.0f);
}
if (sWorld->getBoolConfig(CONFIG_CALCULATE_GAMEOBJECT_ZONE_AREA_DATA))
{
uint32 zoneId = 0;