From bca92b80b92b4ff0d9240e884050d6e94ab27671 Mon Sep 17 00:00:00 2001 From: hondacrx Date: Sat, 5 Nov 2022 17:55:37 -0400 Subject: [PATCH] Fixes a crash when using auction house. and using hearth stone/teleporting. --- Source/Game/Maps/Map.cs | 12 ++++-------- Source/Game/Networking/Packets/ItemPackets.cs | 7 +++++++ Source/Scripts/Events/Midsummer.cs | 2 +- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/Source/Game/Maps/Map.cs b/Source/Game/Maps/Map.cs index db7ad99a2..6d4d194cd 100644 --- a/Source/Game/Maps/Map.cs +++ b/Source/Game/Maps/Map.cs @@ -1661,7 +1661,7 @@ namespace Game.Maps return new TransferAbortParams(TransferAbortReason.MapNotAllowed); if (!entry.IsDungeon()) - return TransferAbortParams.None; + return null; Difficulty targetDifficulty = player.GetDifficultyID(entry); // Get the highest available difficulty if current setting is higher than the instance allows @@ -1671,7 +1671,7 @@ namespace Game.Maps //Bypass checks for GMs if (player.IsGameMaster()) - return TransferAbortParams.None; + return null; //Other requirements { @@ -1702,7 +1702,7 @@ namespace Game.Maps return new TransferAbortParams(TransferAbortReason.TooManyInstances); } - return TransferAbortParams.None; + return null; } public string GetMapName() @@ -3219,7 +3219,7 @@ namespace Game.Maps return i_InstanceId; } - public virtual TransferAbortParams CannotEnter(Player player) { return TransferAbortParams.None; } + public virtual TransferAbortParams CannotEnter(Player player) { return null; } public Difficulty GetDifficultyID() { @@ -5219,8 +5219,6 @@ namespace Game.Maps public class TransferAbortParams { - public static TransferAbortParams None = new TransferAbortParams(); - public TransferAbortReason Reason; public byte Arg; public uint MapDifficultyXConditionId; @@ -5231,8 +5229,6 @@ namespace Game.Maps Arg = arg; MapDifficultyXConditionId = mapDifficultyXConditionId; } - - public bool IsFailed() { return Reason != TransferAbortReason.None; } } public struct ScriptAction diff --git a/Source/Game/Networking/Packets/ItemPackets.cs b/Source/Game/Networking/Packets/ItemPackets.cs index f93b89fff..710e9b238 100644 --- a/Source/Game/Networking/Packets/ItemPackets.cs +++ b/Source/Game/Networking/Packets/ItemPackets.cs @@ -959,6 +959,13 @@ namespace Game.Networking.Packets public static bool operator ==(ItemInstance left, ItemInstance right) { + if (ReferenceEquals(left, right)) + return true; + if (ReferenceEquals(left, null)) + return false; + if (ReferenceEquals(right, null)) + return false; + if (left.ItemID != right.ItemID) return false; diff --git a/Source/Scripts/Events/Midsummer.cs b/Source/Scripts/Events/Midsummer.cs index 6a1c3f982..692a32112 100644 --- a/Source/Scripts/Events/Midsummer.cs +++ b/Source/Scripts/Events/Midsummer.cs @@ -71,7 +71,7 @@ namespace Scripts.Events.Midsummer public const uint TorchCatchingA = 11657; public const uint TorchCatchingH = 11923; public const uint MoreTorchCatchingA = 11924; - public const uint MoreTorchCatchingH = 1192; + public const uint MoreTorchCatchingH = 11925; } [Script] // 45724 - Braziers Hit!