fix camel gear not being equipable by anyone

This commit is contained in:
Bluzume 2021-11-06 22:53:06 -04:00
parent d837b3d8ea
commit c58326ffba
2 changed files with 7 additions and 5 deletions

View file

@ -43,7 +43,9 @@ namespace HISP.Game.Items
public int GetMiscFlag(int no)
{
if (MiscFlags.Length <= no)
if (no < 0)
return 0;
if (no >= MiscFlags.Length)
return 0;
else
return MiscFlags[no];

View file

@ -2512,14 +2512,14 @@ namespace HISP.Game
foreach(InventoryItem item in user.Inventory.GetItemList())
{
Item.ItemInformation itemInfo = item.ItemInstances[0].GetItemInfo();
Item.ItemInformation itemInfo = Item.GetItemById(item.ItemId);
if (itemInfo.Type == "TACK")
{
if (horse.Breed.Type == "camel" && itemInfo.GetMiscFlag(2) != 1)
if (horse.Breed.Type == "camel" && itemInfo.GetMiscFlag(1) != 1)
continue;
else if (horse.Breed.Type == "llama" && itemInfo.GetMiscFlag(2) != 2)
else if (horse.Breed.Type == "llama" && itemInfo.GetMiscFlag(1) != 2)
continue;
else if (itemInfo.GetMiscFlag(2) != 0)
else if (itemInfo.GetMiscFlag(1) != 0)
continue;
message += Messages.FormatHorseEquip(itemInfo.IconId, item.ItemInstances.Length, itemInfo.Name, itemInfo.Id);
}