mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 01:37:00 +00:00
[11922] Add ASSERT helper function to print entry and guid info
Use this in first cases: GetAngle and in PathFinder::BuildPolyPath Signed-off-by: Schmoozerd <schmoozerd@scriptdev2.com>
This commit is contained in:
parent
b03443c425
commit
49bd484a41
6 changed files with 23 additions and 11 deletions
|
|
@ -883,6 +883,15 @@ bool Object::PrintIndexError(uint32 index, bool set) const
|
|||
return false;
|
||||
}
|
||||
|
||||
bool Object::PrintEntryError(char const* descr) const
|
||||
{
|
||||
sLog.outError("Object Type %u, Entry %u (lowguid %u) with invalid call for %s", GetTypeId(), GetEntry(), GetObjectGuid().GetCounter(), descr);
|
||||
|
||||
// always false for continue assert fail
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
void Object::BuildUpdateDataForPlayer(Player* pl, UpdateDataMapType& update_players)
|
||||
{
|
||||
UpdateDataMapType::iterator iter = update_players.find(pl);
|
||||
|
|
@ -1190,7 +1199,7 @@ float WorldObject::GetAngle(const WorldObject* obj) const
|
|||
if (!obj)
|
||||
return 0.0f;
|
||||
|
||||
MANGOS_ASSERT(obj != this);
|
||||
MANGOS_ASSERT(obj != this || PrintEntryError("GetAngle (for self)"));
|
||||
|
||||
return GetAngle(obj->GetPositionX(), obj->GetPositionY());
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue