mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 01:37:00 +00:00
[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:
parent
0f12e9cc3e
commit
f46f4e1b87
2 changed files with 17 additions and 10 deletions
|
|
@ -2120,10 +2120,9 @@ void Creature::GetRespawnCoord( float &x, float &y, float &z, float* ori, float*
|
|||
*ori = data->orientation;
|
||||
if (dist)
|
||||
*dist = GetRespawnRadius();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
float orient;
|
||||
|
||||
GetSummonPoint(x, y, z, orient);
|
||||
|
|
@ -2134,6 +2133,14 @@ void Creature::GetRespawnCoord( float &x, float &y, float &z, float* ori, float*
|
|||
*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()
|
||||
{
|
||||
if (lootForBody && !HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SKINNABLE))
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "11319"
|
||||
#define REVISION_NR "11320"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue