Dougan Ironfist
Sorceror
Not sure if this is the right forum for this, but I found a bug with stack splitting. Basically you start with a container that contains 125 items and one of those items is a stack. Now split the stack and drop the new stack back into the container. You will get a message there is too many items, but you will now have 126 items. You could do this indefinitely.
While working on a custom container, I devised a way to correct this. A similar method could be added to the core Item.cs file. The code I used to correct the problem is listed below. Hope this helps.
Dougan Ironfist
While working on a custom container, I devised a way to correct this. A similar method could be added to the core Item.cs file. The code I used to correct the problem is listed below. Hope this helps.
Dougan Ironfist
Code:
private Serial m_LastLifted;
private Serial m_LastAddFail;
public override void OnItemAdded(Item item)
{
if (item.Serial == m_LastLifted && item.Serial == m_LastAddFail)
{
if (Parent is Container)
((Item)Parent).AddItem(item);
else if (RootParent is Mobile)
item.MoveToWorld(((Mobile)RootParent).Location);
else if (RootParent == null)
item.MoveToWorld(Location);
}
}
public override bool CheckHold(Mobile m, Item item, bool message, bool checkItems, int plusItems, int plusWeight)
{
if (!base.CheckHold(m, item, message, checkItems, plusItems, plusWeight))
{
m_LastAddFail = item.Serial;
return false;
}
else
{
m_LastAddFail = 0;
return true;
}
}
public override bool CheckLift(Mobile from, Item item, ref LRReason reject)
{
m_LastLifted = item.Serial;
}