Core/GameObjects: Validate rotation quaternion at startup
Port From (https://github.com/TrinityCore/TrinityCore/commit/9005bdc684eb37718371f921bd570692375a6c7a)
This commit is contained in:
@@ -4214,6 +4214,12 @@ namespace Game
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!(Math.Abs(Quaternion.Dot(data.rotation, data.rotation) - 1) < 1e-5))
|
||||
{
|
||||
Log.outError(LogFilter.Sql, $"Table `gameobject` has gameobject (GUID: {guid} Entry: {data.Id}) with invalid rotation quaternion (non-unit), defaulting to orientation on Z axis only");
|
||||
data.rotation = Quaternion.CreateFromRotationMatrix(Extensions.fromEulerAnglesZYX(data.spawnPoint.GetOrientation(), 0f, 0f));
|
||||
}
|
||||
|
||||
if (WorldConfig.GetBoolValue(WorldCfg.CalculateGameobjectZoneAreaData))
|
||||
{
|
||||
PhasingHandler.InitDbVisibleMapId(phaseShift, data.terrainSwapMap);
|
||||
|
||||
Reference in New Issue
Block a user