diff options
Diffstat (limited to 'src/server/game/Globals/ObjectMgr.cpp')
-rw-r--r-- | src/server/game/Globals/ObjectMgr.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 50d8ffec5ae..da63150df5d 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -34,6 +34,7 @@ #include "LFGMgr.h" #include "Log.h" #include "MapManager.h" +#include "Object.h" #include "ObjectMgr.h" #include "Pet.h" #include "PoolMgr.h" @@ -1727,6 +1728,12 @@ void ObjectMgr::LoadCreatures() data.phaseMask = 1; } + if (std::abs(data.orientation) > 2 * float(M_PI)) + { + TC_LOG_ERROR("sql.sql", "Table `creature` has creature (GUID: %u Entry: %u) with abs(`orientation`) > 2*PI (orientation is expressed in radians), normalized.", guid, data.id); + data.orientation = Position::NormalizeOrientation(data.orientation); + } + // Add to grid if not managed by the game event or pool system if (gameEvent == 0 && PoolId == 0) AddCreatureToGrid(guid, &data); @@ -2009,6 +2016,12 @@ void ObjectMgr::LoadGameobjects() int16 gameEvent = fields[16].GetInt8(); uint32 PoolId = fields[17].GetUInt32(); + if (std::abs(data.orientation) > 2 * float(M_PI)) + { + TC_LOG_ERROR("sql.sql", "Table `gameobject` has gameobject (GUID: %u Entry: %u) with abs(`orientation`) > 2*PI (orientation is expressed in radians), normalized.", guid, data.id); + data.orientation = Position::NormalizeOrientation(data.orientation); + } + if (data.rotation2 < -1.0f || data.rotation2 > 1.0f) { TC_LOG_ERROR("sql.sql", "Table `gameobject` has gameobject (GUID: %u Entry: %u) with invalid rotation2 (%f) value, skip", guid, data.id, data.rotation2); |