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:
+17
-12
@@ -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,20 +5000,25 @@ namespace Game.Maps
|
|||||||
raidInstanceMessage.DifficultyID = GetDifficultyID();
|
raidInstanceMessage.DifficultyID = GetDifficultyID();
|
||||||
raidInstanceMessage.Write();
|
raidInstanceMessage.Write();
|
||||||
|
|
||||||
PendingRaidLock pendingRaidLock = new();
|
|
||||||
pendingRaidLock.TimeUntilLock = 60000;
|
|
||||||
pendingRaidLock.CompletedMask = i_instanceLock.GetData().CompletedEncountersMask;
|
|
||||||
pendingRaidLock.Extending = true;
|
|
||||||
pendingRaidLock.WarningOnly = GetEntry().IsFlexLocking();
|
|
||||||
pendingRaidLock.Write();
|
|
||||||
|
|
||||||
foreach (Player player in GetPlayers())
|
foreach (Player player in GetPlayers())
|
||||||
{
|
|
||||||
player.SendPacket(raidInstanceMessage);
|
player.SendPacket(raidInstanceMessage);
|
||||||
player.SendPacket(pendingRaidLock);
|
|
||||||
|
|
||||||
if (!pendingRaidLock.WarningOnly)
|
if (i_data != null)
|
||||||
player.SetPendingBind(GetInstanceId(), 60000);
|
{
|
||||||
|
PendingRaidLock pendingRaidLock = new();
|
||||||
|
pendingRaidLock.TimeUntilLock = 60000;
|
||||||
|
pendingRaidLock.CompletedMask = i_instanceLock.GetData().CompletedEncountersMask;
|
||||||
|
pendingRaidLock.Extending = true;
|
||||||
|
pendingRaidLock.WarningOnly = GetEntry().IsFlexLocking();
|
||||||
|
pendingRaidLock.Write();
|
||||||
|
|
||||||
|
foreach (Player player in GetPlayers())
|
||||||
|
{
|
||||||
|
player.SendPacket(pendingRaidLock);
|
||||||
|
|
||||||
|
if (!pendingRaidLock.WarningOnly)
|
||||||
|
player.SetPendingBind(GetInstanceId(), 60000);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user