Store pendingInstanceId instead of pointer of instance save, because pointer may become invalid. Fix #2987.
This commit is contained in:
@@ -1754,7 +1754,7 @@ void Player::Update(uint32 p_time)
|
||||
if (_pendingBindTimer <= p_time)
|
||||
{
|
||||
// Player left the instance
|
||||
if (_pendingBind->GetInstanceId() == GetInstanceId())
|
||||
if (_pendingBindId == GetInstanceId())
|
||||
BindToInstance();
|
||||
SetPendingBind(NULL, 0);
|
||||
}
|
||||
@@ -18021,10 +18021,14 @@ InstancePlayerBind* Player::BindToInstance(InstanceSave* save, bool permanent, b
|
||||
|
||||
void Player::BindToInstance()
|
||||
{
|
||||
InstanceSave* mapSave = sInstanceSaveMgr->GetInstanceSave(_pendingBindId);
|
||||
if (!mapSave) //it seems sometimes mapSave is NULL, but I did not check why
|
||||
return;
|
||||
|
||||
WorldPacket data(SMSG_INSTANCE_SAVE_CREATED, 4);
|
||||
data << uint32(0);
|
||||
GetSession()->SendPacket(&data);
|
||||
BindToInstance(_pendingBind, true);
|
||||
BindToInstance(mapSave, true);
|
||||
}
|
||||
|
||||
void Player::SendRaidInfo()
|
||||
|
||||
Reference in New Issue
Block a user