fix: Simplifies ore stack logic (#1319)
This commit is contained in:
parent
f47560e56c
commit
b18dfcbb63
3 changed files with 36 additions and 41 deletions
|
|
@ -49,17 +49,9 @@ public abstract partial class Food : Item
|
|||
}
|
||||
}
|
||||
|
||||
public override bool CanStackWith(Item dropped)
|
||||
{
|
||||
if (dropped is Food food)
|
||||
{
|
||||
if (Poison != food.Poison || Poisoner != food.Poisoner)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return base.CanStackWith(dropped);
|
||||
}
|
||||
public override bool CanStackWith(Item dropped) =>
|
||||
(dropped is not Food food || Poison == food.Poison && Poisoner == food.Poisoner) &&
|
||||
base.CanStackWith(dropped);
|
||||
|
||||
|
||||
public virtual bool Eat(Mobile from)
|
||||
|
|
|
|||
|
|
@ -54,10 +54,8 @@ public abstract partial class BaseOre : Item
|
|||
};
|
||||
|
||||
public override bool CanStackWith(Item dropped) =>
|
||||
dropped.Stackable && Stackable && dropped.Hue == Hue &&
|
||||
dropped.GetType() == GetType() && dropped.ItemID == ItemID &&
|
||||
(dropped as BaseOre)?._resource == _resource && dropped.Name == Name &&
|
||||
dropped.Amount + Amount <= 60000 && dropped != this;
|
||||
base.CanStackWith(dropped) &&
|
||||
(dropped as BaseOre)?._resource == _resource;
|
||||
|
||||
public override void AddNameProperty(IPropertyList list)
|
||||
{
|
||||
|
|
@ -444,4 +442,4 @@ public partial class ValoriteOre : BaseOre
|
|||
}
|
||||
|
||||
public override BaseIngot GetIngot() => new ValoriteIngot();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue