mirror of
https://github.com/mangosfour/server.git
synced 2025-12-26 16:37:06 +00:00
[9598] update battlegrounds per map + cleanup at delete
this will be useful, if we have multithreaded mapupdates one day since i couldn't reproduce any errors regarding to self deletions of battlegrounds i removed the m_deleteThis variable
This commit is contained in:
parent
24d45c6a08
commit
1b2eefd721
7 changed files with 19 additions and 40 deletions
|
|
@ -225,7 +225,6 @@ BattleGround::BattleGround()
|
|||
m_LevelMin = 0;
|
||||
m_LevelMax = 0;
|
||||
m_InBGFreeSlotQueue = false;
|
||||
m_SetDeleteThis = false;
|
||||
|
||||
m_MaxPlayersPerTeam = 0;
|
||||
m_MaxPlayers = 0;
|
||||
|
|
@ -296,6 +295,7 @@ BattleGround::~BattleGround()
|
|||
}
|
||||
|
||||
sBattleGroundMgr.RemoveBattleGround(GetInstanceID(), GetTypeID());
|
||||
sBattleGroundMgr.DeleteClientVisibleInstanceId(GetTypeID(), GetBracketId(), GetClientInstanceID());
|
||||
|
||||
// unload map
|
||||
// map can be null at bg destruction
|
||||
|
|
@ -324,7 +324,8 @@ void BattleGround::Update(uint32 diff)
|
|||
// ]]
|
||||
// BattleGround Template instance cannot be updated, because it would be deleted
|
||||
if (!GetInvitedCount(HORDE) && !GetInvitedCount(ALLIANCE))
|
||||
m_SetDeleteThis = true;
|
||||
delete this;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue