[11325] Made recently added coordinates check only for debug build mode.

This commit is contained in:
VladimirMangos 2011-04-08 00:09:48 +04:00
parent 633b84b235
commit 96045a86e3
5 changed files with 11 additions and 7 deletions

View file

@ -2142,11 +2142,7 @@ void Creature::GetRespawnCoord( float &x, float &y, float &z, float* ori, float*
} }
//lets check if our creatures have valid spawn coordinates //lets check if our creatures have valid spawn coordinates
if(!MaNGOS::IsValidMapCoord(x, y, z)) MANGOS_ASSERT(MaNGOS::IsValidMapCoord(x, y, z) || PrintCoordinatesError(x, y, z, "respawn"));
{
sLog.outError("Creature with invalid respawn coordinates: mapid = %u, guid = %u, x = %f, y = %f, z = %f", GetMapId(), GetGUIDLow(), x, y, z);
MANGOS_ASSERT(false);
}
} }
void Creature::AllLootRemovedFromCorpse() void Creature::AllLootRemovedFromCorpse()

View file

@ -165,7 +165,6 @@ class MANGOS_DLL_SPEC Map : public GridRefManager<NGridType>
bool CreatureRespawnRelocation(Creature *c); // used only in CreatureRelocation and ObjectGridUnloader bool CreatureRespawnRelocation(Creature *c); // used only in CreatureRelocation and ObjectGridUnloader
// ASSERT print helper
bool CheckGridIntegrity(Creature* c, bool moved) const; bool CheckGridIntegrity(Creature* c, bool moved) const;
uint32 GetInstanceId() const { return i_InstanceId; } uint32 GetInstanceId() const { return i_InstanceId; }

View file

@ -2011,4 +2011,10 @@ bool WorldObject::IsControlledByPlayer() const
default: default:
return false; return false;
} }
}
bool WorldObject::PrintCoordinatesError(float x, float y, float z, char const* descr) const
{
sLog.outError("%s with invalid %s coordinates: mapid = %uu, x = %f, y = %f, z = %f", GetGuidStr().c_str(), descr, GetMapId(), x, y, z);
return false; // always false for continue assert fail
} }

View file

@ -576,6 +576,9 @@ class MANGOS_DLL_SPEC WorldObject : public Object
bool isActiveObject() const { return m_isActiveObject || m_viewPoint.hasViewers(); } bool isActiveObject() const { return m_isActiveObject || m_viewPoint.hasViewers(); }
ViewPoint& GetViewPoint() { return m_viewPoint; } ViewPoint& GetViewPoint() { return m_viewPoint; }
// ASSERT print helper
bool PrintCoordinatesError(float x, float y, float z, char const* descr) const;
protected: protected:
explicit WorldObject(); explicit WorldObject();

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "11324" #define REVISION_NR "11325"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__