diff --git a/src/game/Creature.cpp b/src/game/Creature.cpp index a9ad5dcac..6f0012f8b 100644 --- a/src/game/Creature.cpp +++ b/src/game/Creature.cpp @@ -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 - if(!MaNGOS::IsValidMapCoord(x, y, z)) - { - 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); - } + MANGOS_ASSERT(MaNGOS::IsValidMapCoord(x, y, z) || PrintCoordinatesError(x, y, z, "respawn")); } void Creature::AllLootRemovedFromCorpse() diff --git a/src/game/Map.h b/src/game/Map.h index 2066c36b2..9dd4af4d8 100644 --- a/src/game/Map.h +++ b/src/game/Map.h @@ -165,7 +165,6 @@ class MANGOS_DLL_SPEC Map : public GridRefManager bool CreatureRespawnRelocation(Creature *c); // used only in CreatureRelocation and ObjectGridUnloader - // ASSERT print helper bool CheckGridIntegrity(Creature* c, bool moved) const; uint32 GetInstanceId() const { return i_InstanceId; } diff --git a/src/game/Object.cpp b/src/game/Object.cpp index 3eac14831..418d20ee8 100644 --- a/src/game/Object.cpp +++ b/src/game/Object.cpp @@ -2011,4 +2011,10 @@ bool WorldObject::IsControlledByPlayer() const default: 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 } \ No newline at end of file diff --git a/src/game/Object.h b/src/game/Object.h index d77032dda..68f7b0d7f 100644 --- a/src/game/Object.h +++ b/src/game/Object.h @@ -576,6 +576,9 @@ class MANGOS_DLL_SPEC WorldObject : public Object bool isActiveObject() const { return m_isActiveObject || m_viewPoint.hasViewers(); } ViewPoint& GetViewPoint() { return m_viewPoint; } + + // ASSERT print helper + bool PrintCoordinatesError(float x, float y, float z, char const* descr) const; protected: explicit WorldObject(); diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 78233587d..15361e496 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "11324" + #define REVISION_NR "11325" #endif // __REVISION_NR_H__