[11320] Check if Creature::GetRespawnCoord() function returns valid map coordinates. Invalid data might cause crashes with movement generators.

Signed-off-by: Ambal <pogrebniak@gala.net>
This commit is contained in:
Ambal 2011-04-06 10:53:43 +03:00
parent 0f12e9cc3e
commit f46f4e1b87
2 changed files with 17 additions and 10 deletions

View file

@ -2120,18 +2120,25 @@ void Creature::GetRespawnCoord( float &x, float &y, float &z, float* ori, float*
*ori = data->orientation;
if (dist)
*dist = GetRespawnRadius();
}
else
{
float orient;
return;
GetSummonPoint(x, y, z, orient);
if (ori)
*ori = orient;
if (dist)
*dist = GetRespawnRadius();
}
float orient;
GetSummonPoint(x, y, z, orient);
if (ori)
*ori = orient;
if (dist)
*dist = GetRespawnRadius();
//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);
}
}
void Creature::AllLootRemovedFromCorpse()

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "11319"
#define REVISION_NR "11320"
#endif // __REVISION_NR_H__