diff options
| author | Shauren <shauren.trinity@gmail.com> | 2019-05-23 20:00:35 +0200 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2021-12-06 23:27:05 +0100 |
| commit | 9005bdc684eb37718371f921bd570692375a6c7a (patch) | |
| tree | 73f9a12a8143c3ebb8e21ef607d343127f331b52 /src | |
| parent | de19555c89349ddd112c2d100e179af9eb11f1ac (diff) | |
Core/GameObjects: Validate rotation quaternion at startup
Ref #23306
(cherry picked from commit 9dbedb6b644860020e5abd369fb59c63f49727b8)
Diffstat (limited to 'src')
| -rw-r--r-- | src/server/game/Globals/ObjectMgr.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 30a92203fbc..328ec7314d8 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -2537,6 +2537,12 @@ void ObjectMgr::LoadGameObjects() continue; } + if (!data.rotation.isUnit()) + { + TC_LOG_ERROR("sql.sql", "Table `gameobject` has gameobject (GUID: " UI64FMTD " 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; |
