Core/Instances: Delete InstanceSaveMgr and replace most of its uses with new InstanceLockMgr

Port From (https://github.com/TrinityCore/TrinityCore/commit/9b924522d0549dd67b10e2cbdfc20297dd21e182)
This commit is contained in:
hondacrx
2022-10-04 10:57:04 -04:00
parent 793cf91a24
commit 66c7047a29
27 changed files with 186 additions and 1545 deletions
+12 -3
View File
@@ -430,7 +430,7 @@ namespace Game.Maps
bossInfo.state = state;
SaveToDB();
if (state == EncounterState.Done)
if (state == EncounterState.Done && dungeonEncounter != null)
instance.UpdateInstanceLock(dungeonEncounter, new(id, state));
}
@@ -754,11 +754,20 @@ namespace Game.Maps
return false;
}
bool IsEncounterCompleted(uint dungeonEncounterId)
{
for (uint i = 0; i < bosses.Count; ++i)
for (var j = 0; j < bosses[i].DungeonEncounters.Length; ++j)
if (bosses[i].DungeonEncounters[j] != null && bosses[i].DungeonEncounters[j].Id == dungeonEncounterId)
return bosses[i].state == EncounterState.Done;
return false;
}
public void SetEntranceLocation(uint worldSafeLocationId)
{
_entranceId = worldSafeLocationId;
if (_temporaryEntranceId != 0)
_temporaryEntranceId = 0;
_temporaryEntranceId = 0;
}
public void SendEncounterUnit(EncounterFrameType type, Unit unit = null, byte priority = 0)