mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 19:37:02 +00:00
[8739] Call cleaniup code at remove player from Map before Map unlinking.
This fix crash when aura remove triggering spell casting.
This commit is contained in:
parent
a22c0f05b9
commit
6cab460f6b
2 changed files with 6 additions and 11 deletions
|
|
@ -722,6 +722,11 @@ void Map::Update(const uint32 &t_diff)
|
||||||
|
|
||||||
void Map::Remove(Player *player, bool remove)
|
void Map::Remove(Player *player, bool remove)
|
||||||
{
|
{
|
||||||
|
if(remove)
|
||||||
|
player->CleanupsBeforeDelete();
|
||||||
|
else
|
||||||
|
player->RemoveFromWorld();
|
||||||
|
|
||||||
// this may be called during Map::Update
|
// this may be called during Map::Update
|
||||||
// after decrement+unlink, ++m_mapRefIter will continue correctly
|
// after decrement+unlink, ++m_mapRefIter will continue correctly
|
||||||
// when the first element of the list is being removed
|
// when the first element of the list is being removed
|
||||||
|
|
@ -733,11 +738,6 @@ void Map::Remove(Player *player, bool remove)
|
||||||
CellPair p = MaNGOS::ComputeCellPair(player->GetPositionX(), player->GetPositionY());
|
CellPair p = MaNGOS::ComputeCellPair(player->GetPositionX(), player->GetPositionY());
|
||||||
if(p.x_coord >= TOTAL_NUMBER_OF_CELLS_PER_MAP || p.y_coord >= TOTAL_NUMBER_OF_CELLS_PER_MAP)
|
if(p.x_coord >= TOTAL_NUMBER_OF_CELLS_PER_MAP || p.y_coord >= TOTAL_NUMBER_OF_CELLS_PER_MAP)
|
||||||
{
|
{
|
||||||
if(remove)
|
|
||||||
player->CleanupsBeforeDelete();
|
|
||||||
else
|
|
||||||
player->RemoveFromWorld();
|
|
||||||
|
|
||||||
// invalid coordinates
|
// invalid coordinates
|
||||||
player->ResetMap();
|
player->ResetMap();
|
||||||
|
|
||||||
|
|
@ -759,11 +759,6 @@ void Map::Remove(Player *player, bool remove)
|
||||||
NGridType *grid = getNGrid(cell.GridX(), cell.GridY());
|
NGridType *grid = getNGrid(cell.GridX(), cell.GridY());
|
||||||
assert(grid != NULL);
|
assert(grid != NULL);
|
||||||
|
|
||||||
if(remove)
|
|
||||||
player->CleanupsBeforeDelete();
|
|
||||||
else
|
|
||||||
player->RemoveFromWorld();
|
|
||||||
|
|
||||||
RemoveFromGrid(player,grid,cell);
|
RemoveFromGrid(player,grid,cell);
|
||||||
|
|
||||||
SendRemoveTransports(player);
|
SendRemoveTransports(player);
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "8738"
|
#define REVISION_NR "8739"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue