Fixes FindItemsByType and FindItemByType and new override of IsLockedDown and IsSecure by renaming their methods.
This commit is contained in:
parent
7321fa1b63
commit
a48ebb3a5f
50 changed files with 416 additions and 643 deletions
|
|
@ -1,4 +1,5 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Server.Gumps;
|
||||
using Server.Items;
|
||||
using Server.Network;
|
||||
|
|
@ -310,30 +311,20 @@ namespace Server.Engines.Plants
|
|||
}
|
||||
case 6: // Water
|
||||
{
|
||||
Item[] item = from.Backpack.FindItemsByType(typeof(BaseBeverage));
|
||||
BaseBeverage bev = from.Backpack.FindItemsByType<BaseBeverage>().Find(beverage =>
|
||||
beverage.IsEmpty && beverage.Pourable && beverage.Content == BeverageType.Water);
|
||||
|
||||
bool foundUsableWater = false;
|
||||
|
||||
if (item != null && item.Length > 0)
|
||||
for (int i = 0; i < item.Length; ++i)
|
||||
{
|
||||
BaseBeverage beverage = (BaseBeverage)item[i];
|
||||
|
||||
if (!beverage.IsEmpty && beverage.Pourable && beverage.Content == BeverageType.Water)
|
||||
{
|
||||
foundUsableWater = true;
|
||||
m_Plant.Pour(from, beverage);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!foundUsableWater)
|
||||
if (bev == null)
|
||||
{
|
||||
from.Target = new PlantPourTarget(m_Plant);
|
||||
from.SendLocalizedMessage(1060808,
|
||||
"#" + m_Plant
|
||||
.GetLocalizedPlantStatus()); // Target the container you wish to use to water the ~1_val~.
|
||||
}
|
||||
else
|
||||
{
|
||||
m_Plant.Pour(from, bev);
|
||||
}
|
||||
|
||||
from.SendGump(new MainPlantGump(m_Plant));
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue