Core/Instances: Prevent sending PendingRaidLock in instances that don't have a InstanceScript

Port From (https://github.com/TrinityCore/TrinityCore/commit/75a306e422cfb83c688b90ea428522251a70e68b)
This commit is contained in:
hondacrx
2024-02-03 14:04:56 -05:00
parent f2888995e4
commit 89ad2414c4
+7 -2
View File
@@ -4977,7 +4977,7 @@ namespace Game.Maps
public InstanceResetResult Reset(InstanceResetMethod method) public InstanceResetResult Reset(InstanceResetMethod method)
{ {
// raids can be reset if no boss was killed // raids can be reset if no boss was killed
if (method != InstanceResetMethod.Expire && i_instanceLock != null && !i_instanceLock.IsNew()) if (method != InstanceResetMethod.Expire && i_instanceLock != null && !i_instanceLock.IsNew() && i_data != null)
return InstanceResetResult.CannotReset; return InstanceResetResult.CannotReset;
if (HavePlayers()) if (HavePlayers())
@@ -5000,6 +5000,11 @@ namespace Game.Maps
raidInstanceMessage.DifficultyID = GetDifficultyID(); raidInstanceMessage.DifficultyID = GetDifficultyID();
raidInstanceMessage.Write(); raidInstanceMessage.Write();
foreach (Player player in GetPlayers())
player.SendPacket(raidInstanceMessage);
if (i_data != null)
{
PendingRaidLock pendingRaidLock = new(); PendingRaidLock pendingRaidLock = new();
pendingRaidLock.TimeUntilLock = 60000; pendingRaidLock.TimeUntilLock = 60000;
pendingRaidLock.CompletedMask = i_instanceLock.GetData().CompletedEncountersMask; pendingRaidLock.CompletedMask = i_instanceLock.GetData().CompletedEncountersMask;
@@ -5009,12 +5014,12 @@ namespace Game.Maps
foreach (Player player in GetPlayers()) foreach (Player player in GetPlayers())
{ {
player.SendPacket(raidInstanceMessage);
player.SendPacket(pendingRaidLock); player.SendPacket(pendingRaidLock);
if (!pendingRaidLock.WarningOnly) if (!pendingRaidLock.WarningOnly)
player.SetPendingBind(GetInstanceId(), 60000); player.SetPendingBind(GetInstanceId(), 60000);
} }
}
break; break;
} }
default: default: