From 9ab8d071d944657773cc6f96fe343909a32bb4b5 Mon Sep 17 00:00:00 2001 From: Bluzume <39113159+KuromeSan@users.noreply.github.com> Date: Sun, 28 Nov 2021 22:37:55 -0500 Subject: [PATCH] Add some checks --- .../HorseIsleServer/Game/Inventory/ShopInventory.cs | 3 +++ HorseIsleServer/HorseIsleServer/Server/GameServer.cs | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/HorseIsleServer/HorseIsleServer/Game/Inventory/ShopInventory.cs b/HorseIsleServer/HorseIsleServer/Game/Inventory/ShopInventory.cs index 85c928f..3869ea2 100644 --- a/HorseIsleServer/HorseIsleServer/Game/Inventory/ShopInventory.cs +++ b/HorseIsleServer/HorseIsleServer/Game/Inventory/ShopInventory.cs @@ -115,6 +115,9 @@ namespace HISP.Game.Inventory } public int GetSortPos(InventoryItem item) { + if (item == null) + return 0; + int bias = 1000; int sortBy = Item.GetItemById(item.ItemId).SortBy; if (item.Infinite) diff --git a/HorseIsleServer/HorseIsleServer/Server/GameServer.cs b/HorseIsleServer/HorseIsleServer/Server/GameServer.cs index c309056..bd707c0 100644 --- a/HorseIsleServer/HorseIsleServer/Server/GameServer.cs +++ b/HorseIsleServer/HorseIsleServer/Server/GameServer.cs @@ -615,7 +615,10 @@ namespace HISP.Server case PacketBuilder.SOCIALS_USE: int socialId = Convert.ToInt32(packet[2] - (byte)0x21); SocialType.Social social = SocialType.GetSocial(socialId); - + /* + * Check if player being socialed with + * is actually on this tile, not muted, etc + */ if (sender.LoggedinUser.SocializingWith != null && social.BaseSocialType.Type != "GROUP") { if (sender.LoggedinUser.SocializingWith.MuteAll || sender.LoggedinUser.SocializingWith.MuteSocials)