Hello!!! i have a annoying bug on my server, whenever a player start harvesting and MOVE away before the harvest is done they get the failmessage

''You loosen some rocks but fail to find any useable ore''


then they cant mine every again, until i restart the shard :confused::confused::confused::confused::confused:


im using runuo 2.2 is that helps.... thisi s very annoying

Edit: i think i fixed it, it was the HarvestTimer.cs.. not sure thought, could be the abortaction


Default runuo 2.2 harvestimer.cs
Code:
using System;

namespace Server.Engines.Harvest
{
    public class HarvestTimer : Timer
    {
        private Mobile m_From;
        private Item m_Tool;
        private HarvestSystem m_System;
        private HarvestDefinition m_Definition;
        private object m_ToHarvest, m_Locked;
        private int m_Index, m_Count;

        public HarvestTimer( Mobile from, Item tool, HarvestSystem system, HarvestDefinition def, object toHarvest, object locked ) : base( TimeSpan.Zero, def.EffectDelay )
        {
            m_From = from;
            m_Tool = tool;
            m_System = system;
            m_Definition = def;
            m_ToHarvest = toHarvest;
            m_Locked = locked;
            m_Count = Utility.RandomList( def.EffectCounts );
        }

        protected override void OnTick()
        {
            if ( !m_System.OnHarvesting( m_From, m_Tool, m_Definition, m_ToHarvest, m_Locked, ++m_Index == m_Count ) )
                Stop();
        }
    }
}


my harvesttimer.cs

Code:
using System;
using Server.Mobiles;

namespace Server.Engines.Harvest
{
    public class HarvestTimer : Timer, IAction
    {
        private readonly Mobile m_From;
        private readonly Item m_Tool;
        private readonly HarvestSystem m_System;
        private readonly HarvestDefinition m_Definition;
        private readonly object m_ToHarvest;
        private readonly object m_Locked;
        private int m_Index;
        private readonly int m_Count;

        public HarvestTimer(Mobile from, Item tool, HarvestSystem system, HarvestDefinition def, object toHarvest, object locked)
            : base(TimeSpan.Zero, def.EffectDelay)
        {
            m_From = from;
            m_Tool = tool;
            m_System = system;
            m_Definition = def;
            m_ToHarvest = toHarvest;
            m_Locked = locked;
            //m_Count = Utility.RandomList( def.EffectCounts );
            m_Count = 1 + Utility.Random(1, 5);

            //Update the action
            if (from is PlayerMobile)
                ((PlayerMobile)from).ResetPlayerAction(this);
        }

        protected override void OnTick()
        {
            if (!m_System.OnHarvesting(m_From, m_Tool, m_Definition, m_ToHarvest, m_Locked, ++m_Index == m_Count))
            {
                if (m_From is PlayerMobile)
                    ((PlayerMobile)m_From).EndPlayerAction();

                Stop();
            }
        }

        #region IAction Members

        public void AbortAction(Mobile from)
        {
            m_Definition.SendMessageTo(from, m_Definition.FailMessage);

            if (from is PlayerMobile)
                ((PlayerMobile)from).EndPlayerAction();

            Stop();
        }

        #endregion
    }
}
 
Last edited:
Back