Skip to content

Commit

Permalink
[11966] Replace an ASSERT to prevent unnecessairy crashes
Browse files Browse the repository at this point in the history
GetAngle can be called for self from very many places, not only DB-errors, hence adding the assert is too strong in the moment

Signed-off-by: Schmoozerd <[email protected]>
  • Loading branch information
Schmoozerd committed Apr 16, 2012
1 parent 667a568 commit 2f03b28
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions src/game/Object.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1199,8 +1199,13 @@ float WorldObject::GetAngle(const WorldObject* obj) const
if (!obj)
return 0.0f;

MANGOS_ASSERT(obj != this || PrintEntryError("GetAngle (for self)"));

// Rework the assert, when more cases where such a call can happen have been fixed
//MANGOS_ASSERT(obj != this || PrintEntryError("GetAngle (for self)"));
if (obj == this)
{
sLog.outError("INVALID CALL for GetAngle for %s", obj->GetGuidStr().c_str());
return 0.0f;
}
return GetAngle(obj->GetPositionX(), obj->GetPositionY());
}

Expand Down
2 changes: 1 addition & 1 deletion src/shared/revision_nr.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "11965"
#define REVISION_NR "11966"
#endif // __REVISION_NR_H__

0 comments on commit 2f03b28

Please sign in to comment.