From 91c0fd1924be26b7b58f3e2713e1a8b4472cd31c Mon Sep 17 00:00:00 2001 From: hondacrx Date: Thu, 18 Feb 2021 13:04:07 -0500 Subject: [PATCH] Misc fixes. --- Source/BNetServer/Networking/RestSession.cs | 6 ++++++ Source/Game/Entities/Creature/Creature.cs | 8 +++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Source/BNetServer/Networking/RestSession.cs b/Source/BNetServer/Networking/RestSession.cs index 2f728fb73..f1c7e7efc 100644 --- a/Source/BNetServer/Networking/RestSession.cs +++ b/Source/BNetServer/Networking/RestSession.cs @@ -26,6 +26,12 @@ namespace BNetServer.Networking public async override void ReadHandler(byte[] data, int receivedLength) { + if (receivedLength == 0) + { + CloseSocket(); + return; + } + var httpRequest = HttpHelper.ParseRequest(data, receivedLength); if (httpRequest == null) return; diff --git a/Source/Game/Entities/Creature/Creature.cs b/Source/Game/Entities/Creature/Creature.cs index 25b47db5c..79abcab11 100644 --- a/Source/Game/Entities/Creature/Creature.cs +++ b/Source/Game/Entities/Creature/Creature.cs @@ -2603,7 +2603,7 @@ namespace Game.Entities public float GetPetChaseDistance() { - float range = SharedConst.MeleeRange; + float range = 0f; for (byte i = 0; i < GetPetAutoSpellSize(); ++i) { @@ -2614,10 +2614,8 @@ namespace Game.Entities SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(spellID, GetMap().GetDifficultyID()); if (spellInfo != null) { - if (spellInfo.GetRecoveryTime() == 0 // No cooldown - && spellInfo.RangeEntry.Id != 1 /*Self*/ && spellInfo.RangeEntry.Id != 2 /*Combat Range*/ - && spellInfo.GetMinRange() > range) - range = spellInfo.GetMinRange(); + if (spellInfo.GetRecoveryTime() == 0 && spellInfo.RangeEntry.Id != 1 /*Self*/ && spellInfo.RangeEntry.Id != 2 /*Combat Range*/ && spellInfo.GetMaxRange() > range) + range = spellInfo.GetMaxRange(); } }