RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Stack Split Bug

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

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;
        }
 

Jeff

Lord
Have you tried this on a plain stock build of RunUO... i looked at the code and don't see how its possible.
 

Jeff

Lord
No worries, just remember to always try on the latest version, things are always getting updated ;)
 
Top