aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorVincent-Michael <Vincent_Michael@gmx.de>2014-10-11 05:33:08 +0200
committerVincent-Michael <Vincent_Michael@gmx.de>2014-10-11 05:33:34 +0200
commit0a897616dae34a26af4be516f25cc3c916905340 (patch)
treecfd0015d01ed133eea513d63dce95255381d71cc /src
parent402ac71ee80d029ec027fe8113a1eee5c1470e10 (diff)
Core/SAI: Added new error for wrong target orientation value
Diffstat (limited to 'src')
-rw-r--r--src/server/game/AI/SmartScripts/SmartScriptMgr.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp
index 80ca1b27be4..40f37acf1f7 100644
--- a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp
+++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp
@@ -295,6 +295,10 @@ void SmartAIMgr::LoadSmartAIFromDB()
bool SmartAIMgr::IsTargetValid(SmartScriptHolder const& e)
{
+ if (std::abs(e.target.o) > 2 * float(M_PI))
+ TC_LOG_ERROR("sql.sql", "SmartAIMgr: Entry %d SourceType %u Event %u Action %u has abs(`target.o`) > 2*PI (orientation is expressed in radians)",
+ e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType());
+
if (e.GetActionType() == SMART_ACTION_INSTALL_AI_TEMPLATE)
return true; // AI template has special handling
switch (e.GetTargetType())