From 82856df6104ad8b3d7079df8e3bd3ba3e0789734 Mon Sep 17 00:00:00 2001 From: Kamron Batman Date: Thu, 6 Dec 2018 12:41:44 -0800 Subject: [PATCH] Fixes bug with props gump (#10) --- Scripts/Gumps/Props/PropsGump.cs | 12 ++++--- Scripts/Misc/VendorGenerator.cs | 62 ++++++-------------------------- Scripts/Regions/HouseRegion.cs | 2 +- 3 files changed, 19 insertions(+), 57 deletions(-) diff --git a/Scripts/Gumps/Props/PropsGump.cs b/Scripts/Gumps/Props/PropsGump.cs index 1d0d3e606..7ed7093c1 100644 --- a/Scripts/Gumps/Props/PropsGump.cs +++ b/Scripts/Gumps/Props/PropsGump.cs @@ -572,12 +572,14 @@ namespace Server.Gumps if (baseType == typeofObject || baseType?.GetProperty(prop.Name, prop.PropertyType) == null) break; - + type = baseType; } - + if (type != null && !groups.ContainsKey(type)) groups[type] = new List{ prop }; + else + groups[type].Add(prop); } } } @@ -657,13 +659,13 @@ namespace Server.Gumps return 0; if (x == null) return -1; - + return y == null ? 1 : x.Name.CompareTo(x.Name); } } private class GroupComparer : IComparer>> - { + { private Type m_Start; public GroupComparer(Type start) @@ -689,4 +691,4 @@ namespace Server.Gumps } } } -} \ No newline at end of file +} diff --git a/Scripts/Misc/VendorGenerator.cs b/Scripts/Misc/VendorGenerator.cs index a8a38f218..0d1a0f181 100644 --- a/Scripts/Misc/VendorGenerator.cs +++ b/Scripts/Misc/VendorGenerator.cs @@ -281,62 +281,22 @@ namespace Server private static bool IsArmor(int itemID) { - if (itemID >= 0x13BB && itemID <= 0x13E2) - return true; - - if (itemID >= 0x13E5 && itemID <= 0x13F2) - return true; - - if (itemID >= 0x1408 && itemID <= 0x141A) - return true; - - if (itemID >= 0x144E && itemID <= 0x1457) - return true; - - return false; + return itemID >= 0x13BB && itemID <= 0x13E2 || itemID >= 0x13E5 && itemID <= 0x13F2 || + itemID >= 0x1408 && itemID <= 0x141A || itemID >= 0x144E && itemID <= 0x1457; } private static bool IsMetalWeapon(int itemID) { - if (itemID >= 0xF43 && itemID <= 0xF4E) - return true; - - if (itemID >= 0xF51 && itemID <= 0xF52) - return true; - - if (itemID >= 0xF5C && itemID <= 0xF63) - return true; - - if (itemID >= 0x13AF && itemID <= 0x13B0) - return true; - - if (itemID >= 0x13B5 && itemID <= 0x13BA) - return true; - - if (itemID >= 0x13FA && itemID <= 0x13FB) - return true; - - if (itemID >= 0x13FE && itemID <= 0x1407) - return true; - - if (itemID >= 0x1438 && itemID <= 0x1443) - return true; - - return false; + return itemID >= 0xF43 && itemID <= 0xF4E || itemID >= 0xF51 && itemID <= 0xF52 || + itemID >= 0xF5C && itemID <= 0xF63 || itemID >= 0x13AF && itemID <= 0x13B0 || + itemID >= 0x13B5 && itemID <= 0x13BA || itemID >= 0x13FA && itemID <= 0x13FB || + itemID >= 0x13FE && itemID <= 0x1407 || itemID >= 0x1438 && itemID <= 0x1443; } private static bool IsArcheryWeapon(int itemID) { - if (itemID >= 0xF4F && itemID <= 0xF50) - return true; - - if (itemID >= 0x13B1 && itemID <= 0x13B2) - return true; - - if (itemID >= 0x13FC && itemID <= 0x13FD) - return true; - - return false; + return itemID >= 0xF4F && itemID <= 0xF50 || itemID >= 0x13B1 && itemID <= 0x13B2 || + itemID >= 0x13FC && itemID <= 0x13FD; } private static ShopFlags ProcessDisplayedItem(int itemID) @@ -481,9 +441,9 @@ namespace Server floor.Add(p); for (int xo = -1; xo <= 1; ++xo) - for (int yo = -1; yo <= 1; ++yo) - if ((xo != 0 || yo != 0) && IsFloor(map, x + xo, y + yo, false)) - RecurseFindFloor(map, x + xo, y + yo, floor); + for (int yo = -1; yo <= 1; ++yo) + if ((xo != 0 || yo != 0) && IsFloor(map, x + xo, y + yo, false)) + RecurseFindFloor(map, x + xo, y + yo, floor); } [Flags] diff --git a/Scripts/Regions/HouseRegion.cs b/Scripts/Regions/HouseRegion.cs index 1203e1d46..964c8ab5c 100644 --- a/Scripts/Regions/HouseRegion.cs +++ b/Scripts/Regions/HouseRegion.cs @@ -91,7 +91,7 @@ namespace Server.Regions if (bc?.NoHouseRestrictions == true) { } - else if (bc.IsHouseSummonable == true && + else if (bc?.IsHouseSummonable == true && !(BaseCreature.Summoning || House.IsInside(oldLocation, 16))) { }