*Add an assert to find a bug.

--HG--
branch : trunk
This commit is contained in:
megamage
2009-05-29 12:08:06 -05:00
parent 21462d4895
commit 106766e4ac
2 changed files with 10 additions and 9 deletions
+8 -8
View File
@@ -1428,14 +1428,14 @@ bool WorldObject::HasInArc(const float arcangle, const WorldObject* obj) const
float angle = GetAngle( obj ); float angle = GetAngle( obj );
angle -= m_orientation; angle -= m_orientation;
if(angle > 100 || angle < -100) //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, // 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(), // GetEntry(), GetGUIDLow(), GetPositionX(), GetPositionY(), GetPositionZ(), GetOrientation(),
obj->GetEntry(), obj->GetGUIDLow(), obj->GetPositionX(), obj->GetPositionY(), obj->GetPositionZ(), obj->GetOrientation()); // obj->GetEntry(), obj->GetGUIDLow(), obj->GetPositionX(), obj->GetPositionY(), obj->GetPositionZ(), obj->GetOrientation());
assert(false); // assert(false);
return false; // return false;
} //}
// move angle to range -pi ... +pi // move angle to range -pi ... +pi
while( angle > M_PI) while( angle > M_PI)
+2 -1
View File
@@ -383,6 +383,7 @@ class TRINITY_DLL_SPEC WorldObject : public Object
void Relocate(float x, float y, float z, float orientation) void Relocate(float x, float y, float z, float orientation)
{ {
assert(orientation > -100 && orientation < 100);
m_positionX = x; m_positionX = x;
m_positionY = y; m_positionY = y;
m_positionZ = z; m_positionZ = z;
@@ -402,7 +403,7 @@ class TRINITY_DLL_SPEC WorldObject : public Object
Relocate(loc.x, loc.y, loc.z, loc.o); 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 GetPositionX( ) const { return m_positionX; }
float GetPositionY( ) const { return m_positionY; } float GetPositionY( ) const { return m_positionY; }