public override bool CheckHold(Mobile m, Item item, bool message, bool checkItems, int plusItems, int plusWeight) { if (this.IsSecure && !BaseHouse.CheckHold(m, this, item, message, checkItems, plusItems, plusWeight)) { return(false); } return(base.CheckHold(m, item, message, checkItems, plusItems, plusWeight)); }
public override bool CheckHold(Mobile m, Item item, bool message, bool checkItems, int plusItems, int plusWeight) { // is in a house, check housing rules if (!BaseHouse.CheckHold(m, this, item, message, checkItems)) { return(false); } //return base.CheckHold( m, item, message, checkItems ); int maxItems = this.MaxItems; if (checkItems && maxItems != 0 && (this.TotalItems + plusItems + item.TotalItems + (item.IsVirtualItem ? 0 : 1)) > maxItems) { if (message) { SendFullItemsMessage(m, item); } return(false); } else { int maxWeight = this.MaxWeight; if (maxWeight != 0 && (this.TotalWeight + plusWeight + item.TotalWeight + item.PileWeight) > maxWeight) { if (message) { SendFullWeightMessage(m, item); } return(false); } } object parent = this.Parent; while (parent != null) { if (parent is Container) { return(((Container)parent).CheckHold(m, item, message, checkItems, plusItems, plusWeight)); } else if (parent is Item) { parent = ((Item)parent).Parent; } else { break; } } return(true); }
public override bool CheckHold(Mobile m, Item item, bool message, bool checkItems = true, int plusItems = 0, int plusWeight = 0) => IsSecure && !BaseHouse.CheckHold(m, this, item, message, checkItems, plusItems, plusWeight) ? false : base.CheckHold(m, item, message, checkItems, plusItems, plusWeight);