fix(Core/Instances): skip unowned instance bindings (#27167)

This commit is contained in:
moostigre
2026-08-15 16:23:46 +02:00
committed by GitHub
parent a576109d57
commit 0c0a332792
@@ -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);