Server.Items.WheatSheaf.OnTarget C# (CSharp) Method

OnTarget() public method

public OnTarget ( Mobile from, object obj ) : void
from Mobile
obj object
return void
		public virtual void OnTarget( Mobile from, object obj )
		{
			if ( obj is AddonComponent )
				obj = (obj as AddonComponent).Addon;

			IFlourMill mill = obj as IFlourMill;

			if ( mill != null )
			{
				int needs = mill.MaxFlour - mill.CurFlour;

				if ( needs > this.Amount )
					needs = this.Amount;

				mill.CurFlour += needs;
				Consume( needs );
			}
		}