mirror of
https://gitcode.com/GitHub_Trending/az/azerothcore-wotlk.git
synced 2026-10-10 07:06:38 +08:00
fix(Core/Instances): skip unowned instance bindings (#27167)
This commit is contained in:
@@ -791,6 +791,7 @@ void InstanceSaveMgr::_ResetOrWarnAll(uint32 mapid, Difficulty difficulty, bool
|
||||
|
||||
InstancePlayerBind* InstanceSaveMgr::PlayerBindToInstance(ObjectGuid guid, InstanceSave* save, bool permanent, Player* player /*= nullptr*/)
|
||||
{
|
||||
bool const persistBinding = !sToCloud9Sidecar->ClusterModeEnabled() || sToCloud9Sidecar->IsMapAssigned(save->GetMapId());
|
||||
InstancePlayerBind& bind = playerBindStorage[guid]->m[save->GetDifficulty()][save->GetMapId()];
|
||||
ASSERT(!bind.perm || permanent); // ensure there's no changing permanent to temporary, this can be done only by unbinding
|
||||
|
||||
@@ -805,7 +806,8 @@ InstancePlayerBind* InstanceSaveMgr::PlayerBindToInstance(ObjectGuid guid, Insta
|
||||
stmt->SetData(1, permanent);
|
||||
stmt->SetData(2, guid.GetCounter());
|
||||
stmt->SetData(3, bind.save->GetInstanceId());
|
||||
CharacterDatabase.Execute(stmt);
|
||||
if (persistBinding)
|
||||
CharacterDatabase.Execute(stmt);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -832,7 +834,8 @@ InstancePlayerBind* InstanceSaveMgr::PlayerBindToInstance(ObjectGuid guid, Insta
|
||||
stmt->SetData(0, guid.GetCounter());
|
||||
stmt->SetData(1, save->GetInstanceId());
|
||||
stmt->SetData(2, permanent);
|
||||
CharacterDatabase.Execute(stmt);
|
||||
if (persistBinding)
|
||||
CharacterDatabase.Execute(stmt);
|
||||
|
||||
if (player)
|
||||
player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_RAID, 1);
|
||||
|
||||
Reference in New Issue
Block a user