mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-16 13:09:50 -04:00
*Fix a crash caused by relocationnotify
--HG-- branch : trunk
This commit is contained in:
@@ -649,12 +649,14 @@ void Map::AddUnitToNotify(Unit* u)
|
||||
}
|
||||
}
|
||||
|
||||
void Map::RemoveUnitFromNotify(int32 slot)
|
||||
void Map::RemoveUnitFromNotify(Unit *unit, int32 slot)
|
||||
{
|
||||
if(i_lock)
|
||||
{
|
||||
assert(slot < i_unitsToNotifyBacklog.size());
|
||||
i_unitsToNotifyBacklog[slot] = NULL;
|
||||
if(slot < i_unitsToNotifyBacklog.size() && i_unitsToNotifyBacklog[slot] == unit)
|
||||
i_unitsToNotifyBacklog[slot] = NULL;
|
||||
else if(slot < i_unitsToNotify.size() && i_unitsToNotify[slot] == unit)
|
||||
i_unitsToNotify[slot] = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -404,7 +404,7 @@ class MANGOS_DLL_SPEC Map : public GridRefManager<NGridType>, public MaNGOS::Obj
|
||||
bool ActiveObjectsNearGrid(uint32 x, uint32 y) const;
|
||||
|
||||
void AddUnitToNotify(Unit* unit);
|
||||
void RemoveUnitFromNotify(int32 slot);
|
||||
void RemoveUnitFromNotify(Unit *unit, int32 slot);
|
||||
|
||||
void SendToPlayers(WorldPacket const* data) const;
|
||||
|
||||
|
||||
@@ -12366,7 +12366,7 @@ void Unit::RemoveFromWorld()
|
||||
|
||||
if(m_NotifyListPos >= 0)
|
||||
{
|
||||
GetMap()->RemoveUnitFromNotify(m_NotifyListPos);
|
||||
GetMap()->RemoveUnitFromNotify(this, m_NotifyListPos);
|
||||
m_NotifyListPos = -1;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user