Misc fixes.

This commit is contained in:
hondacrx
2021-02-18 13:04:07 -05:00
parent 6a6ae408ea
commit 91c0fd1924
2 changed files with 9 additions and 5 deletions
@@ -26,6 +26,12 @@ namespace BNetServer.Networking
public async override void ReadHandler(byte[] data, int receivedLength) public async override void ReadHandler(byte[] data, int receivedLength)
{ {
if (receivedLength == 0)
{
CloseSocket();
return;
}
var httpRequest = HttpHelper.ParseRequest(data, receivedLength); var httpRequest = HttpHelper.ParseRequest(data, receivedLength);
if (httpRequest == null) if (httpRequest == null)
return; return;
+3 -5
View File
@@ -2603,7 +2603,7 @@ namespace Game.Entities
public float GetPetChaseDistance() public float GetPetChaseDistance()
{ {
float range = SharedConst.MeleeRange; float range = 0f;
for (byte i = 0; i < GetPetAutoSpellSize(); ++i) for (byte i = 0; i < GetPetAutoSpellSize(); ++i)
{ {
@@ -2614,10 +2614,8 @@ namespace Game.Entities
SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(spellID, GetMap().GetDifficultyID()); SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(spellID, GetMap().GetDifficultyID());
if (spellInfo != null) if (spellInfo != null)
{ {
if (spellInfo.GetRecoveryTime() == 0 // No cooldown if (spellInfo.GetRecoveryTime() == 0 && spellInfo.RangeEntry.Id != 1 /*Self*/ && spellInfo.RangeEntry.Id != 2 /*Combat Range*/ && spellInfo.GetMaxRange() > range)
&& spellInfo.RangeEntry.Id != 1 /*Self*/ && spellInfo.RangeEntry.Id != 2 /*Combat Range*/ range = spellInfo.GetMaxRange();
&& spellInfo.GetMinRange() > range)
range = spellInfo.GetMinRange();
} }
} }