fix: Fixes quiver logic (#805)

This commit is contained in:
Kamron Batman 2021-09-26 19:07:42 -07:00 committed by GitHub
parent 2253a2332c
commit 551078670d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -181,19 +181,29 @@ namespace Server.Items
public override bool CheckHold(Mobile m, Item item, bool message, bool checkItems, int plusItems, int plusWeight)
{
if (CheckType(item))
if (!CheckType(item))
{
return Items.Count >= DefaultMaxItems && !checkItems && Ammo?.Deleted == false &&
Ammo.Amount + item.Amount <= m_Capacity || item.Amount <= m_Capacity &&
base.CheckHold(m, item, message, checkItems, plusItems, plusWeight);
if (message)
{
m.SendLocalizedMessage( 1074836 ); // The container can not hold that type of object.
}
return false;
}
if (message)
if (Items.Count < DefaultMaxItems)
{
m.SendLocalizedMessage(1074836); // The container can not hold that type of object.
return item.Amount <= m_Capacity && base.CheckHold(m, item, message, checkItems, plusItems, plusWeight);
}
return false;
if (checkItems)
{
return false;
}
Item ammo = Ammo;
return ammo?.Deleted == false && ammo.Amount + item.Amount <= m_Capacity;
}
public override void AddItem(Item dropped)