From 106766e4ac01e766b3d01ab16cbb1871b4dd5fa6 Mon Sep 17 00:00:00 2001 From: megamage Date: Fri, 29 May 2009 12:08:06 -0500 Subject: *Add an assert to find a bug. --HG-- branch : trunk --- src/game/Object.cpp | 16 ++++++++-------- src/game/Object.h | 3 ++- 2 files changed, 10 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/game/Object.cpp b/src/game/Object.cpp index 46a824b99c7..dd6b23e458f 100644 --- a/src/game/Object.cpp +++ b/src/game/Object.cpp @@ -1428,14 +1428,14 @@ bool WorldObject::HasInArc(const float arcangle, const WorldObject* obj) const float angle = GetAngle( obj ); angle -= m_orientation; - if(angle > 100 || angle < -100) - { - sLog.outCrash("Invalid Angle %f: this %u %u %f %f %f %f, that %u %u %f %f %f %f", angle, - GetEntry(), GetGUIDLow(), GetPositionX(), GetPositionY(), GetPositionZ(), GetOrientation(), - obj->GetEntry(), obj->GetGUIDLow(), obj->GetPositionX(), obj->GetPositionY(), obj->GetPositionZ(), obj->GetOrientation()); - assert(false); - return false; - } + //if(angle > 100 || angle < -100) + //{ + // sLog.outCrash("Invalid Angle %f: this %u %u %f %f %f %f, that %u %u %f %f %f %f", angle, + // GetEntry(), GetGUIDLow(), GetPositionX(), GetPositionY(), GetPositionZ(), GetOrientation(), + // obj->GetEntry(), obj->GetGUIDLow(), obj->GetPositionX(), obj->GetPositionY(), obj->GetPositionZ(), obj->GetOrientation()); + // assert(false); + // return false; + //} // move angle to range -pi ... +pi while( angle > M_PI) diff --git a/src/game/Object.h b/src/game/Object.h index b8dde77ae57..098cb0893aa 100644 --- a/src/game/Object.h +++ b/src/game/Object.h @@ -383,6 +383,7 @@ class TRINITY_DLL_SPEC WorldObject : public Object void Relocate(float x, float y, float z, float orientation) { + assert(orientation > -100 && orientation < 100); m_positionX = x; m_positionY = y; m_positionZ = z; @@ -402,7 +403,7 @@ class TRINITY_DLL_SPEC WorldObject : public Object Relocate(loc.x, loc.y, loc.z, loc.o); } - void SetOrientation(float orientation) { m_orientation = orientation; } + void SetOrientation(float orientation) { assert(orientation > -100 && orientation < 100); m_orientation = orientation; } float GetPositionX( ) const { return m_positionX; } float GetPositionY( ) const { return m_positionY; } -- cgit v1.2.3