mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 10:37:02 +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,18 +2120,25 @@ void Creature::GetRespawnCoord( float &x, float &y, float &z, float* ori, float*
|
||||||
*ori = data->orientation;
|
*ori = data->orientation;
|
||||||
if (dist)
|
if (dist)
|
||||||
*dist = GetRespawnRadius();
|
*dist = GetRespawnRadius();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
float orient;
|
||||||
|
|
||||||
return;
|
GetSummonPoint(x, y, z, orient);
|
||||||
|
|
||||||
|
if (ori)
|
||||||
|
*ori = orient;
|
||||||
|
if (dist)
|
||||||
|
*dist = GetRespawnRadius();
|
||||||
}
|
}
|
||||||
|
|
||||||
float orient;
|
//lets check if our creatures have valid spawn coordinates
|
||||||
|
if(!MaNGOS::IsValidMapCoord(x, y, z))
|
||||||
GetSummonPoint(x, y, z, orient);
|
{
|
||||||
|
sLog.outError("Creature with invalid respawn coordinates: mapid = %u, guid = %u, x = %f, y = %f, z = %f", GetMapId(), GetGUIDLow(), x, y, z);
|
||||||
if (ori)
|
MANGOS_ASSERT(false);
|
||||||
*ori = orient;
|
}
|
||||||
if (dist)
|
|
||||||
*dist = GetRespawnRadius();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Creature::AllLootRemovedFromCorpse()
|
void Creature::AllLootRemovedFromCorpse()
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "11319"
|
#define REVISION_NR "11320"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue