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!

[Bug Fix] Glass Pitchers: Fill From StaticTargets

Vorspire

Knight
Empty Glass Pitchers can only be filled by targeting a Water Trough (Crafted or Deeded version), or another water container or beverage with water.

I have written a fix that will enable Pitchers to be filled using static troughs, water barrels and moving water tiles (non-still water, like waterfalls, rapids, etc).

Entirely new section of code added, spans lines 804 to 826 in Scripts/Items/Food/Beverage.cs
Original file version: SVN REV 885

Code:
else if (targ is StaticTarget)
{
	StaticTarget src = (StaticTarget)targ;

	if (src == null)
		return;

	if (src.ItemID >= 2881 && src.ItemID <= 2884 || src.ItemID == 3707 || src.ItemID == 5453 || src.ItemID >= 13549 && src.ItemID <= 13608)
	{
		if (!from.InRange(src.Location, 2) || !from.InLOS(src))
		{
			from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that.
			return;
		}

		this.Content = BeverageType.Water;
		this.Poison = null;
		this.Poisoner = null;
		this.Quantity = this.MaxQuantity;

		from.SendLocalizedMessage(1010089); // You fill the container with water.
	}
}

Without this fix, using the pitchers on static versions of the supported items results in no message and no action.
 

fwiffo

Sorceror
add a HUE check, maybe someone is using the static water tiles to reproduce something like other kind of liquids. Just a tought

Why this one below the first check? wouldn't it be more sane to do it before?
if (src == null)
return;
 

Vorspire

Knight
Why this one below the first check? wouldn't it be more sane to do it before?
if (src == null)
return;

Good eye you have there, this code is the result of lazy splicing after a 48-hour stint of no sleep.

Good job fwiffo ;)

The null check will probably never be needed anyway.
 
Top