diff options
author | Vincent-Michael <Vincent_Michael@gmx.de> | 2014-09-20 22:39:37 +0200 |
---|---|---|
committer | Vincent-Michael <Vincent_Michael@gmx.de> | 2014-09-20 22:39:37 +0200 |
commit | f767aef12eaf2e55deed89590eb9e8a39b0d1653 (patch) | |
tree | c8737ba6d3d7065daf61046ed9d424d7bfc7c5e0 /src/server/game/Globals/ObjectMgr.cpp | |
parent | 8e288dd6731ed608d8285f9f966783ee9b46eebf (diff) | |
parent | 72d08a146f3ca8369f173b9293d564673155491a (diff) |
Merge branch 'master' of github.com:TrinityCore/TrinityCore into 4.3.4
Conflicts:
src/server/game/Achievements/AchievementMgr.cpp
src/server/game/Achievements/AchievementMgr.h
src/server/game/Globals/ObjectMgr.cpp
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 2bdfb57adb4..8a8570b7fc6 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -36,6 +36,7 @@ #include "LFGMgr.h" #include "Log.h" #include "MapManager.h" +#include "Object.h" #include "ObjectMgr.h" #include "Pet.h" #include "PoolMgr.h" @@ -1763,6 +1764,12 @@ void ObjectMgr::LoadCreatures() } } + 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); + } + if (data.phaseMask == 0) { TC_LOG_ERROR("sql.sql", "Table `creature` has creature (GUID: %u Entry: %u) with `phaseMask`=0 (not visible for anyone), set to 1.", guid, data.id); @@ -2065,6 +2072,12 @@ void ObjectMgr::LoadGameobjects() data.phaseGroup = 0; } + 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); |