Skip to content

Commit

Permalink
fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
Argalep committed Mar 20, 2019
1 parent 1fa6e28 commit e320839
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 21 deletions.
30 changes: 10 additions & 20 deletions Scripts/Items/Equipment/Instruments/SnakeCharmerFlute.cs
@@ -1,8 +1,9 @@
using System;
using System;
using Server;
using Server.Network;
using Server.Mobiles;
using Server.Targeting;
using System.Linq;

namespace Server.Items
{
Expand Down Expand Up @@ -131,37 +132,26 @@ protected override void OnTarget(Mobile from, object targ)

private static bool IsSnake(BaseCreature bc)
{
Type type = bc.GetType();

for (int i = 0; i < m_SnakeTypes.Length; i++)
{
if (type == m_SnakeTypes[i])
return true;
}

return false;
return m_SnakeTypes.Any(t => t == bc.GetType());
}

private static Type[] m_SnakeTypes = new Type[]
{
typeof( LavaSnake ), typeof( Snake ),
typeof( CoralSnake ), typeof( GiantSerpent ),
typeof( SilverSerpent )
};
{
typeof(LavaSnake), typeof(Snake),
typeof(CoralSnake), typeof(GiantSerpent),
typeof(SilverSerpent)
};

public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);

writer.Write((int)0); // version
}

public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);

/*int version = */
reader.ReadInt();
int version = reader.ReadInt();
}
}
}
}
14 changes: 13 additions & 1 deletion Scripts/Services/Harvest/HarvestSystem.cs
Expand Up @@ -5,6 +5,7 @@
using Server.Engines.Quests;
using Server.Engines.Quests.Hag;
using Server.Mobiles;
using System.Linq;

namespace Server.Engines.Harvest
{
Expand Down Expand Up @@ -770,16 +771,27 @@ public class FurnitureAttribute : Attribute
{
public FurnitureAttribute()
{
}

private static bool IsNotChoppables(Item item)
{
return _NotChoppables.Any(t => t == item.GetType());
}

private static Type[] _NotChoppables = new Type[]
{
typeof(CommodityDeedBox), typeof(ChinaCabinet), typeof(PieSafe), typeof(AcademicBookCase), typeof(JewelryBox),
typeof(WoodenBookcase), typeof(Countertop), typeof(Mailbox)
};

public static bool Check(Item item)
{
if (item == null)
{
return false;
}

if (item is CommodityDeedBox || item is ChinaCabinet || item is PieSafe || item is AcademicBookCase || item is JewelryBox || item is WoodenBookcase || item is Countertop || item is Mailbox)
if (IsNotChoppables(item))
{
return false;
}
Expand Down

0 comments on commit e320839

Please sign in to comment.