From 647d6c0fd09a8fccfe37cc9434aa25d8830a919d Mon Sep 17 00:00:00 2001
From: Kamron Batman <3953314+kamronbatman@users.noreply.github.com>
Date: Sat, 3 Nov 2018 18:07:35 -0700
Subject: [PATCH 1/7] Fixes small compile errors for both Mono and Windows
---
Scripts/Items/Food/Beverage.cs | 5 +++--
Scripts/Mobiles/PlayerMobile.cs | 8 ++------
Server/packages.config | 8 ++++----
3 files changed, 9 insertions(+), 12 deletions(-)
diff --git a/Scripts/Items/Food/Beverage.cs b/Scripts/Items/Food/Beverage.cs
index af564855b..2c54548a4 100644
--- a/Scripts/Items/Food/Beverage.cs
+++ b/Scripts/Items/Food/Beverage.cs
@@ -1104,6 +1104,7 @@ namespace Server.Items
public static void CheckHeaveTimer(Mobile from)
{
+ Timer t;
if (from.BAC > 0 && from.Map != Map.Internal && !from.Deleted)
{
if (m_Table.ContainsKey(from))
@@ -1112,12 +1113,12 @@ namespace Server.Items
if (from.BAC > 60)
from.BAC = 60;
- Timer t = new HeaveTimer(from);
+ t = new HeaveTimer(from);
t.Start();
m_Table[from] = t;
}
- else if (m_Table.TryGetValue(from, out Timer t))
+ else if (m_Table.TryGetValue(from, out t))
{
t.Stop();
m_Table.Remove(from);
diff --git a/Scripts/Mobiles/PlayerMobile.cs b/Scripts/Mobiles/PlayerMobile.cs
index f1ecc1494..8646e6f6e 100644
--- a/Scripts/Mobiles/PlayerMobile.cs
+++ b/Scripts/Mobiles/PlayerMobile.cs
@@ -4728,16 +4728,12 @@ namespace Server.Mobiles
public virtual bool HasRecipe(Recipe r)
{
- if (r == null)
- return false;
-
- return HasRecipe(r.ID);
+ return r != null && HasRecipe(r.ID);
}
public virtual bool HasRecipe(int recipeID)
{
- m_AcquiredRecipes?.TryGetValue(recipeID, out bool value);
- return value;
+ return m_AcquiredRecipes.TryGetValue(recipeID, out bool value) && value;
}
public virtual void AcquireRecipe(Recipe r)
diff --git a/Server/packages.config b/Server/packages.config
index c697f90c1..8e1dc78d7 100644
--- a/Server/packages.config
+++ b/Server/packages.config
@@ -7,7 +7,7 @@
-
-
-
-
\ No newline at end of file
+
+
+
+
\ No newline at end of file
From 82856df6104ad8b3d7079df8e3bd3ba3e0789734 Mon Sep 17 00:00:00 2001
From: Kamron Batman
Date: Thu, 6 Dec 2018 12:41:44 -0800
Subject: [PATCH 2/7] 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)))
{
}
From a7c28c65ed5508b744a8586a1e81917b0cceb1e0 Mon Sep 17 00:00:00 2001
From: Kamron Batman <3953314+kamronbatman@users.noreply.github.com>
Date: Sun, 3 Mar 2019 14:27:33 -0800
Subject: [PATCH 3/7] Little bit of code style changes.
---
Server/Mobile.cs | 13 +------------
Server/Region.cs | 8 ++++----
2 files changed, 5 insertions(+), 16 deletions(-)
diff --git a/Server/Mobile.cs b/Server/Mobile.cs
index 8ffad92a9..ec94cccc1 100644
--- a/Server/Mobile.cs
+++ b/Server/Mobile.cs
@@ -1789,18 +1789,7 @@ namespace Server
[CommandProperty(AccessLevel.Counselor, AccessLevel.GameMaster)]
public Map LogoutMap{ get; set; }
- public Region Region
- {
- get
- {
- if (m_Region == null)
- if (Map == null)
- return Map.Internal.DefaultRegion;
- else
- return Map.DefaultRegion;
- return m_Region;
- }
- }
+ public Region Region => m_Region ?? (Map == null ? Map.Internal.DefaultRegion : Map.DefaultRegion);
public Packet RemovePacket
{
diff --git a/Server/Region.cs b/Server/Region.cs
index 3b7e9458c..9d16ac806 100644
--- a/Server/Region.cs
+++ b/Server/Region.cs
@@ -416,7 +416,7 @@ namespace Server
return false;
}
-
+
// TODO: Memoize this
public T GetRegion() where T : Region
{
@@ -468,7 +468,7 @@ namespace Server
return null;
}
-
+
public bool IsPartOf() where T : Region
{
return GetRegion() != null;
@@ -840,7 +840,7 @@ namespace Server
Console.WriteLine("Could not find root element 'ServerRegions' in Regions.xml");
return;
}
-
+
foreach (XmlElement facet in root.SelectNodes("Facet"))
{
Map map = null;
@@ -1172,4 +1172,4 @@ namespace Server
return true;
}
}
-}
\ No newline at end of file
+}
From 01d0fb75b8198a5a07e19ef5d6969e7bf68526ed Mon Sep 17 00:00:00 2001
From: Kamron Batman
Date: Sun, 3 Mar 2019 15:10:20 -0800
Subject: [PATCH 4/7] Cleanup that was missed during the last sweep. (#14)
---
.../Dark Tides/Items/CrystalCaveBarrier.cs | 36 ++++-----
Scripts/Items/Misc/BankCheck.cs | 9 +--
Scripts/Items/Misc/Gold.cs | 9 +--
.../Carpenter Items/TaxidermyKit.cs | 78 +++++++++----------
.../Humanoid/Melee/KhaldunRevenant.cs | 4 +-
Scripts/Multis/BaseHouse.cs | 4 +-
Server/Commands.cs | 12 +--
Server/Item.cs | 48 +++++-------
Server/ScriptCompiler.cs | 4 -
9 files changed, 93 insertions(+), 111 deletions(-)
diff --git a/Scripts/Engines/Quests/Dark Tides/Items/CrystalCaveBarrier.cs b/Scripts/Engines/Quests/Dark Tides/Items/CrystalCaveBarrier.cs
index 667cd1421..f6d561fc6 100644
--- a/Scripts/Engines/Quests/Dark Tides/Items/CrystalCaveBarrier.cs
+++ b/Scripts/Engines/Quests/Dark Tides/Items/CrystalCaveBarrier.cs
@@ -19,33 +19,31 @@ namespace Server.Engines.Quests.Necro
if (m.AccessLevel > AccessLevel.Player)
return true;
- bool sendMessage = m.Player;
+ Mobile mob = m;
- if (m is BaseCreature)
- m = ((BaseCreature)m).ControlMaster;
+ if (m is BaseCreature creature)
+ mob = creature.ControlMaster;
- if (m is PlayerMobile pm)
+ if (!(mob is PlayerMobile pm))
+ return false;
+
+ QuestSystem qs = pm.Quest;
+
+ if (qs is DarkTidesQuest)
{
- QuestSystem qs = pm.Quest;
+ QuestObjective obj = qs.FindObjective();
- if (qs is DarkTidesQuest)
+ if (obj?.Completed == true)
{
- QuestObjective obj = qs.FindObjective();
+ m.SendLocalizedMessage(
+ 1060648); // With Horus' permission, you are able to pass through the barrier.
- if (obj != null && obj.Completed)
- {
- if (sendMessage)
- m.SendLocalizedMessage(
- 1060648); // With Horus' permission, you are able to pass through the barrier.
-
- return true;
- }
+ return true;
}
}
- if (sendMessage)
- m.SendLocalizedMessage(1060649, "",
- 0x66D); // Without the permission of the guardian Horus, the magic of the barrier prevents your passage.
+ m.SendLocalizedMessage(1060649, "",
+ 0x66D); // Without the permission of the guardian Horus, the magic of the barrier prevents your passage.
return false;
}
@@ -64,4 +62,4 @@ namespace Server.Engines.Quests.Necro
int version = reader.ReadInt();
}
}
-}
\ No newline at end of file
+}
diff --git a/Scripts/Items/Misc/BankCheck.cs b/Scripts/Items/Misc/BankCheck.cs
index cd713bc83..82562a181 100644
--- a/Scripts/Items/Misc/BankCheck.cs
+++ b/Scripts/Items/Misc/BankCheck.cs
@@ -83,11 +83,7 @@ namespace Server.Items
list.Add(1060738, worth); // value: ~1_val~
}
-#if NEWPARENT
public override void OnAdded(IEntity parent)
-#else
- public override void OnAdded(object parent)
-#endif
{
base.OnAdded(parent);
@@ -98,7 +94,8 @@ namespace Server.Items
Container root = parent as Container;
- while (root?.Parent is Container) root = (Container)root.Parent;
+ while (root?.Parent is Container container)
+ root = container;
parent = root ?? parent;
@@ -247,4 +244,4 @@ namespace Server.Items
}
}
}
-}
\ No newline at end of file
+}
diff --git a/Scripts/Items/Misc/Gold.cs b/Scripts/Items/Misc/Gold.cs
index 649088263..dcf92222f 100644
--- a/Scripts/Items/Misc/Gold.cs
+++ b/Scripts/Items/Misc/Gold.cs
@@ -44,11 +44,7 @@ namespace Server.Items
UpdateTotal(this, TotalType.Gold, newValue - oldValue);
}
-#if NEWPARENT
public override void OnAdded(IEntity parent)
-#else
- public override void OnAdded(object parent)
-#endif
{
base.OnAdded(parent);
@@ -59,7 +55,8 @@ namespace Server.Items
Container root = parent as Container;
- while (root?.Parent is Container) root = (Container)root.Parent;
+ while (root?.Parent is Container container)
+ root = container;
parent = root ?? parent;
@@ -127,4 +124,4 @@ namespace Server.Items
int version = reader.ReadInt();
}
}
-}
\ No newline at end of file
+}
diff --git a/Scripts/Items/Skill Items/Carpenter Items/TaxidermyKit.cs b/Scripts/Items/Skill Items/Carpenter Items/TaxidermyKit.cs
index b04a39072..f77aa1669 100644
--- a/Scripts/Items/Skill Items/Carpenter Items/TaxidermyKit.cs
+++ b/Scripts/Items/Skill Items/Carpenter Items/TaxidermyKit.cs
@@ -96,11 +96,13 @@ namespace Server.Items
if (m_Kit.Deleted)
return;
- if (!(targeted is Corpse) && !(targeted is BigFish))
+ Corpse corpse = targeted as Corpse;
+
+ if (!(corpse != null || targeted is BigFish))
{
from.SendLocalizedMessage(1042600); // That is not a corpse!
}
- else if (targeted is Corpse corpse && corpse.VisitedByTaxidermist)
+ else if (corpse?.VisitedByTaxidermist == true)
{
from.SendLocalizedMessage(1042596); // That corpse seems to have been visited by a taxidermist already.
}
@@ -114,48 +116,46 @@ namespace Server.Items
}
else
{
- object obj = targeted;
+ object obj = corpse?.Owner ?? targeted;
- if (obj is Corpse)
- obj = ((Corpse)obj).Owner;
+ foreach (TrophyInfo t in m_Table)
+ {
+ if (t.CreatureType != obj.GetType())
+ continue;
- if (obj != null)
- for (int i = 0; i < m_Table.Length; i++)
- if (m_Table[i].CreatureType == obj.GetType())
+ Container pack = from.Backpack;
+
+ if (pack?.ConsumeTotal(typeof(Board), 10) == true)
+ {
+ from.SendLocalizedMessage(
+ 1042278); // You review the corpse and find it worthy of a trophy.
+ from.SendLocalizedMessage(1042602); // You use your kit up making the trophy.
+
+ Mobile hunter = null;
+ int weight = 0;
+
+ if (targeted is BigFish fish)
{
- Container pack = from.Backpack;
+ hunter = fish.Fisher;
+ weight = (int)fish.Weight;
- if (pack != null && pack.ConsumeTotal(typeof(Board), 10))
- {
- from.SendLocalizedMessage(
- 1042278); // You review the corpse and find it worthy of a trophy.
- from.SendLocalizedMessage(1042602); // You use your kit up making the trophy.
-
- Mobile hunter = null;
- int weight = 0;
-
- if (targeted is BigFish fish)
- {
- hunter = fish.Fisher;
- weight = (int)fish.Weight;
-
- fish.Consume();
- }
-
-
- from.AddToBackpack(new TrophyDeed(m_Table[i], hunter, weight));
-
- if (targeted is Corpse corpse1)
- corpse1.VisitedByTaxidermist = true;
-
- m_Kit.Delete();
- return;
- }
-
- from.SendLocalizedMessage(1042598); // You do not have enough boards.
- return;
+ fish.Consume();
}
+
+ from.AddToBackpack(new TrophyDeed(t, hunter, weight));
+
+ if (corpse != null)
+ corpse.VisitedByTaxidermist = true;
+
+ m_Kit.Delete();
+ return;
+ }
+
+ from.SendLocalizedMessage(1042598); // You do not have enough boards.
+ return;
+ }
+
from.SendLocalizedMessage(1042599); // That does not look like something you want hanging on a wall.
}
}
@@ -539,4 +539,4 @@ namespace Server.Items
}
}
}
-}
\ No newline at end of file
+}
diff --git a/Scripts/Mobiles/Monsters/Humanoid/Melee/KhaldunRevenant.cs b/Scripts/Mobiles/Monsters/Humanoid/Melee/KhaldunRevenant.cs
index 4f0e0c02d..7493bba9f 100644
--- a/Scripts/Mobiles/Monsters/Humanoid/Melee/KhaldunRevenant.cs
+++ b/Scripts/Mobiles/Monsters/Humanoid/Melee/KhaldunRevenant.cs
@@ -77,8 +77,8 @@ namespace Server.Mobiles
Mobile m = e.Mobile;
Mobile lastKiller = m.LastKiller;
- if (lastKiller is BaseCreature)
- lastKiller = ((BaseCreature)lastKiller).GetMaster();
+ if (lastKiller is BaseCreature creature)
+ lastKiller = creature.GetMaster();
if (IsInsideKhaldun(m) && IsInsideKhaldun(lastKiller) && lastKiller.Player && !m_Set.Contains(lastKiller))
foreach (AggressorInfo ai in m.Aggressors)
diff --git a/Scripts/Multis/BaseHouse.cs b/Scripts/Multis/BaseHouse.cs
index cb09944da..e001faf8e 100644
--- a/Scripts/Multis/BaseHouse.cs
+++ b/Scripts/Multis/BaseHouse.cs
@@ -722,8 +722,8 @@ namespace Server.Multis
if (!item.Deleted)
{
- if (item is StrongBox)
- item = ((StrongBox)item).ConvertToStandardContainer();
+ if (item is StrongBox box)
+ item = box.ConvertToStandardContainer();
item.IsLockedDown = false;
item.IsSecure = false;
diff --git a/Server/Commands.cs b/Server/Commands.cs
index e20cee97c..30fa7727d 100644
--- a/Server/Commands.cs
+++ b/Server/Commands.cs
@@ -219,29 +219,29 @@ namespace Server.Commands
if (entry != null)
{
- if (@from.AccessLevel >= entry.AccessLevel)
+ if (from.AccessLevel >= entry.AccessLevel)
{
if (entry.Handler != null)
{
- CommandEventArgs e = new CommandEventArgs(@from, command, argString, args);
+ CommandEventArgs e = new CommandEventArgs(from, command, argString, args);
entry.Handler(e);
EventSink.InvokeCommand(e);
}
}
else
{
- if (@from.AccessLevel <= BadCommandIgnoreLevel)
+ if (from.AccessLevel <= BadCommandIgnoreLevel)
return false;
- @from.SendMessage("You do not have access to that command.");
+ from.SendMessage("You do not have access to that command.");
}
}
else
{
- if (@from.AccessLevel <= BadCommandIgnoreLevel)
+ if (from.AccessLevel <= BadCommandIgnoreLevel)
return false;
- @from.SendMessage("That is not a valid command.");
+ from.SendMessage("That is not a valid command.");
}
return true;
diff --git a/Server/Item.cs b/Server/Item.cs
index 6e4b02a86..68edab5ee 100644
--- a/Server/Item.cs
+++ b/Server/Item.cs
@@ -1134,10 +1134,8 @@ namespace Server
{
IEntity p = m_Parent;
- while (p is Item)
+ while (p is Item item)
{
- Item item = (Item)p;
-
if (item.m_Parent == null) break;
p = item.m_Parent;
@@ -3349,13 +3347,11 @@ namespace Server
{
IEntity p = m_Parent;
- while (p is Item)
+ while (p is Item item)
{
- if (p is T)
+ if (item is T)
return true;
- Item item = (Item)p;
-
if (item.m_Parent == null) break;
p = item.m_Parent;
@@ -4024,12 +4020,12 @@ namespace Server
{
object p = this;
- while (p is Item)
+ while (p is Item item)
{
- if (p is SecureTradeContainer container)
+ if (item is SecureTradeContainer container)
return container;
- p = ((Item)p).m_Parent;
+ p = item.m_Parent;
}
return null;
@@ -4125,10 +4121,8 @@ namespace Server
if (p == o)
return true;
- while (p is Item)
+ while (p is Item item)
{
- Item item = (Item)p;
-
if (item.m_Parent == null)
break;
@@ -4214,22 +4208,22 @@ namespace Server
NetState ns = from.NetState;
- if (ns != null)
+ if (ns == null)
+ return;
+
+ if (Name == null)
{
- if (Name == null)
- {
- if (m_Amount <= 1)
- ns.Send(new MessageLocalized(Serial, m_ItemID, MessageType.Label, 0x3B2, 3, LabelNumber, "", ""));
- else
- ns.Send(new MessageLocalizedAffix(Serial, m_ItemID, MessageType.Label, 0x3B2, 3, LabelNumber, "",
- AffixType.Append,
- $" : {m_Amount}", ""));
- }
+ if (m_Amount <= 1)
+ ns.Send(new MessageLocalized(Serial, m_ItemID, MessageType.Label, 0x3B2, 3, LabelNumber, "", ""));
else
- {
- ns.Send(new UnicodeMessage(Serial, m_ItemID, MessageType.Label, 0x3B2, 3, "ENU", "",
- Name + (m_Amount > 1 ? " : " + m_Amount : "")));
- }
+ ns.Send(new MessageLocalizedAffix(Serial, m_ItemID, MessageType.Label, 0x3B2, 3, LabelNumber, "",
+ AffixType.Append,
+ $" : {m_Amount}", ""));
+ }
+ else
+ {
+ ns.Send(new UnicodeMessage(Serial, m_ItemID, MessageType.Label, 0x3B2, 3, "ENU", "",
+ Name + (m_Amount > 1 ? " : " + m_Amount : "")));
}
}
diff --git a/Server/ScriptCompiler.cs b/Server/ScriptCompiler.cs
index f6a41c46c..8c8bc43fa 100644
--- a/Server/ScriptCompiler.cs
+++ b/Server/ScriptCompiler.cs
@@ -80,10 +80,6 @@ namespace Server
AppendCompilerOption(ref sb, "/d:NEWTIMERS");
#endif
-#if NEWPARENT
- AppendCompilerOption(ref sb, "/d:NEWPARENT");
-#endif
-
return sb?.ToString();
}
From 90ffe0ea3c9c96cb41e1da4c7a9505a3f79a4f6d Mon Sep 17 00:00:00 2001
From: Kamron Batman
Date: Sun, 3 Mar 2019 15:40:17 -0800
Subject: [PATCH 5/7] Fixes parent references. (#15)
---
.../Engines/BulkOrders/Books/BulkOrderBook.cs | 2 +-
Scripts/Engines/ConPVP/Games/BombingRun.cs | 2 +-
Scripts/Engines/ConPVP/Games/CTF.cs | 4 ++--
Scripts/Engines/Factions/Items/Sigil.cs | 4 ++--
Scripts/Gumps/ViewHousesGump.cs | 6 ++----
Scripts/Items/Games/BaseBoard.cs | 8 +++-----
Scripts/Items/Maps/MapItem.cs | 9 ++-------
Scripts/Items/Misc/Scales.cs | 7 ++-----
.../Explosion Potions/BaseExplosionPotion.cs | 20 ++++++++-----------
Scripts/Items/Suits/BaseSuit.cs | 13 +++++-------
Scripts/Misc/Cleanup.cs | 6 ++----
Scripts/Skills/Stealing.cs | 14 ++++++-------
Scripts/Spells/Base/Spell.cs | 2 +-
Scripts/Spells/Third/Telekinesis.cs | 6 ++----
Server/Interfaces.cs | 4 ++--
Server/Item.cs | 9 +--------
Server/Items/Container.cs | 14 ++++---------
Server/Mobile.cs | 6 +++---
Server/NativeReader.cs | 6 +++---
Server/Targeting/Target.cs | 6 ++----
20 files changed, 55 insertions(+), 93 deletions(-)
diff --git a/Scripts/Engines/BulkOrders/Books/BulkOrderBook.cs b/Scripts/Engines/BulkOrders/Books/BulkOrderBook.cs
index 49dc2285e..9d3567516 100644
--- a/Scripts/Engines/BulkOrders/Books/BulkOrderBook.cs
+++ b/Scripts/Engines/BulkOrders/Books/BulkOrderBook.cs
@@ -142,7 +142,7 @@ namespace Server.Engines.BulkOrders
}
}
- public void InvalidateContainers( object parent )
+ public void InvalidateContainers(IEntity parent)
{
if ( parent is Container c )
{
diff --git a/Scripts/Engines/ConPVP/Games/BombingRun.cs b/Scripts/Engines/ConPVP/Games/BombingRun.cs
index 7adbe3b5d..9ca49e657 100644
--- a/Scripts/Engines/ConPVP/Games/BombingRun.cs
+++ b/Scripts/Engines/ConPVP/Games/BombingRun.cs
@@ -44,7 +44,7 @@ namespace Server.Engines.ConPVP
public Mobile Thrower{ get; private set; }
- private Mobile FindOwner(object parent)
+ private Mobile FindOwner(IEntity parent)
{
if (parent is Item item)
return item.RootParent as Mobile;
diff --git a/Scripts/Engines/ConPVP/Games/CTF.cs b/Scripts/Engines/ConPVP/Games/CTF.cs
index abce7730b..526a4277a 100644
--- a/Scripts/Engines/ConPVP/Games/CTF.cs
+++ b/Scripts/Engines/ConPVP/Games/CTF.cs
@@ -455,7 +455,7 @@ namespace Server.Engines.ConPVP
MoveToWorld(m_TeamInfo.Origin, m_TeamInfo.Game.Facet);
}
- private Mobile FindOwner(object parent)
+ private Mobile FindOwner(IEntity parent)
{
if (parent is Item item)
return item.RootParent as Mobile;
@@ -1199,4 +1199,4 @@ namespace Server.Engines.ConPVP
m_FinishTimer = null;
}
}
-}
\ No newline at end of file
+}
diff --git a/Scripts/Engines/Factions/Items/Sigil.cs b/Scripts/Engines/Factions/Items/Sigil.cs
index 916ab3be2..d18dde39a 100644
--- a/Scripts/Engines/Factions/Items/Sigil.cs
+++ b/Scripts/Engines/Factions/Items/Sigil.cs
@@ -181,7 +181,7 @@ namespace Server.Factions
return false;
}
- private Mobile FindOwner(object parent)
+ private Mobile FindOwner(IEntity parent)
{
if (parent is Item item)
return item.RootParent as Mobile;
@@ -453,4 +453,4 @@ namespace Server.Factions
base.Delete();
}
}
-}
\ No newline at end of file
+}
diff --git a/Scripts/Gumps/ViewHousesGump.cs b/Scripts/Gumps/ViewHousesGump.cs
index ccd70cf44..297ab58e9 100644
--- a/Scripts/Gumps/ViewHousesGump.cs
+++ b/Scripts/Gumps/ViewHousesGump.cs
@@ -234,9 +234,7 @@ namespace Server.Gumps
public object FindHouseName(BaseHouse house)
{
int multiID = house.ItemID;
- HousePlacementEntry[] entries;
-
- entries = HousePlacementEntry.ClassicHouses;
+ HousePlacementEntry[] entries = HousePlacementEntry.ClassicHouses;
for (int i = 0; i < entries.Length; ++i)
if (entries[i].MultiID == multiID)
@@ -288,4 +286,4 @@ namespace Server.Gumps
}
}
}
-}
\ No newline at end of file
+}
diff --git a/Scripts/Items/Games/BaseBoard.cs b/Scripts/Items/Games/BaseBoard.cs
index 32a8dc5fe..b39aac3f6 100644
--- a/Scripts/Items/Games/BaseBoard.cs
+++ b/Scripts/Items/Games/BaseBoard.cs
@@ -114,7 +114,7 @@ namespace Server.Items
if (board.IsChildOf(from.Backpack))
return true;
- object root = board.RootParent;
+ IEntity root = board.RootParent;
if (root is Mobile && root != from)
return false;
@@ -122,9 +122,7 @@ namespace Server.Items
if (board.Deleted || board.Map != from.Map || !from.InRange(board.GetWorldLocation(), 1))
return false;
- BaseHouse house = BaseHouse.FindHouseAt(board);
-
- return house != null && house.IsOwner(from);
+ return BaseHouse.FindHouseAt(board)?.IsOwner(from) == true;
}
public class DefaultEntry : ContextMenuEntry
@@ -146,4 +144,4 @@ namespace Server.Items
}
}
}
-}
\ No newline at end of file
+}
diff --git a/Scripts/Items/Maps/MapItem.cs b/Scripts/Items/Maps/MapItem.cs
index 2930e9533..651b37ec3 100644
--- a/Scripts/Items/Maps/MapItem.cs
+++ b/Scripts/Items/Maps/MapItem.cs
@@ -174,12 +174,7 @@ namespace Server.Items
if (!Movable || Protected || !from.InRange(GetWorldLocation(), 2))
return false;
- object root = RootParent;
-
- if (root is Mobile && root != from)
- return false;
-
- return true;
+ return !(RootParent is Mobile && RootParent != from);
}
public void ConvertToWorld(int x, int y, out int worldX, out int worldY)
@@ -381,4 +376,4 @@ namespace Server.Items
}
}
}
-}
\ No newline at end of file
+}
diff --git a/Scripts/Items/Misc/Scales.cs b/Scripts/Items/Misc/Scales.cs
index f10c8cfef..9c33239e4 100644
--- a/Scripts/Items/Misc/Scales.cs
+++ b/Scripts/Items/Misc/Scales.cs
@@ -53,7 +53,7 @@ namespace Server.Items
}
else if (targeted is Item item)
{
- object root = item.RootParent;
+ IEntity root = item.RootParent;
if (root != null && root != from || item.Parent == from)
{
@@ -61,10 +61,7 @@ namespace Server.Items
}
else if (item.Movable)
{
- if (item.Amount > 1)
- message = "You place one item on the scale. ";
- else
- message = "You place that item on the scale. ";
+ message = item.Amount > 1 ? "You place one item on the scale. " : "You place that item on the scale. ";
double weight = item.Weight;
diff --git a/Scripts/Items/Skill Items/Magical/Potions/Explosion Potions/BaseExplosionPotion.cs b/Scripts/Items/Skill Items/Magical/Potions/Explosion Potions/BaseExplosionPotion.cs
index 11331c9ef..7c5771201 100644
--- a/Scripts/Items/Skill Items/Magical/Potions/Explosion Potions/BaseExplosionPotion.cs
+++ b/Scripts/Items/Skill Items/Magical/Potions/Explosion Potions/BaseExplosionPotion.cs
@@ -45,17 +45,13 @@ namespace Server.Items
int version = reader.ReadInt();
}
- public virtual object FindParent(Mobile from)
+ public virtual IEntity FindParent(Mobile from)
{
- Mobile m = HeldBy;
+ if (HeldBy?.Holding == this)
+ return HeldBy;
- if (m != null && m.Holding == this)
- return m;
-
- object obj = RootParent;
-
- if (obj != null)
- return obj;
+ if (RootParent != null)
+ return RootParent;
if (Map == Map.Internal)
return from;
@@ -74,7 +70,7 @@ namespace Server.Items
ThrowTarget targ = from.Target as ThrowTarget;
Stackable = false; // Scavenged explosion potions won't stack with those ones in backpack, and still will explode.
- if (targ != null && targ.Potion == this)
+ if (targ?.Potion == this)
return;
from.RevealingAction();
@@ -107,7 +103,7 @@ namespace Server.Items
if (Deleted)
return;
- object parent = FindParent(from);
+ IEntity parent = FindParent(from);
if (timer == 0)
{
@@ -272,4 +268,4 @@ namespace Server.Items
}
}
}
-}
\ No newline at end of file
+}
diff --git a/Scripts/Items/Suits/BaseSuit.cs b/Scripts/Items/Suits/BaseSuit.cs
index 63ecdf70b..d824c571e 100644
--- a/Scripts/Items/Suits/BaseSuit.cs
+++ b/Scripts/Items/Suits/BaseSuit.cs
@@ -47,15 +47,12 @@ namespace Server.Items
public bool Validate()
{
- object root = RootParent;
+ if (!(RootParent is Mobile mobile) || mobile.AccessLevel >= AccessLevel)
+ return true;
- if (root is Mobile mobile && mobile.AccessLevel < AccessLevel)
- {
- Delete();
- return false;
- }
+ Delete();
+ return false;
- return true;
}
public override void OnSingleClick(Mobile from)
@@ -83,4 +80,4 @@ namespace Server.Items
return from.AccessLevel >= AccessLevel;
}
}
-}
\ No newline at end of file
+}
diff --git a/Scripts/Misc/Cleanup.cs b/Scripts/Misc/Cleanup.cs
index 6ba6d8fd8..407f1d0a0 100644
--- a/Scripts/Misc/Cleanup.cs
+++ b/Scripts/Misc/Cleanup.cs
@@ -66,9 +66,7 @@ namespace Server.Misc
}
else if (item.Layer == Layer.Hair || item.Layer == Layer.FacialHair)
{
- object rootParent = item.RootParent;
-
- if (rootParent is Mobile rootMobile)
+ if (item.RootParent is Mobile rootMobile)
{
if (item.Parent != rootMobile && rootMobile.AccessLevel == AccessLevel.Player)
{
@@ -164,4 +162,4 @@ namespace Server.Misc
return false;
}
}
-}
\ No newline at end of file
+}
diff --git a/Scripts/Skills/Stealing.cs b/Scripts/Skills/Stealing.cs
index 610e198ea..dbb03a2af 100644
--- a/Scripts/Skills/Stealing.cs
+++ b/Scripts/Skills/Stealing.cs
@@ -79,7 +79,7 @@ namespace Server.SkillHandlers
{
Item stolen = null;
- object root = toSteal.RootParent;
+ IEntity root = toSteal.RootParent;
Mobile mobRoot = root as Mobile;
StealableArtifactsSpawner.StealableInstance si = null;
@@ -215,7 +215,7 @@ namespace Server.SkillHandlers
{
m_Thief.SendLocalizedMessage(502710); // You can't steal that!
}
- else if (toSteal.LootType == LootType.Newbied || toSteal.CheckBlessed(root))
+ else if (toSteal.LootType == LootType.Newbied || toSteal.CheckBlessed(mobRoot))
{
m_Thief.SendLocalizedMessage(502710); // You can't steal that!
}
@@ -244,7 +244,7 @@ namespace Server.SkillHandlers
{
m_Thief.SendLocalizedMessage(502710); // You can't steal that!
}
- else if (mobRoot != null && !m_Thief.CanBeHarmful((Mobile)root))
+ else if (mobRoot != null && !m_Thief.CanBeHarmful(mobRoot))
{
}
else if (root is Corpse)
@@ -332,7 +332,7 @@ namespace Server.SkillHandlers
from.RevealingAction();
Item stolen = null;
- object root = null;
+ IEntity root = null;
bool caught = false;
if (target is Item item)
@@ -356,7 +356,7 @@ namespace Server.SkillHandlers
{
m_Thief.SendLocalizedMessage(502710); // You can't steal that!
}
-
+
Mobile mobRoot = root as Mobile;
if (stolen != null)
@@ -395,7 +395,7 @@ namespace Server.SkillHandlers
if (mobRoot?.Player == true && m_Thief is PlayerMobile pm &&
IsInnocentTo(pm, mobRoot) && !IsInGuild(mobRoot))
{
- pm.PermaFlags.Add((Mobile)root);
+ pm.PermaFlags.Add(mobRoot);
pm.Delta(MobileDelta.Noto);
}
}
@@ -484,4 +484,4 @@ namespace Server.SkillHandlers
}
}
}
-}
\ No newline at end of file
+}
diff --git a/Scripts/Spells/Base/Spell.cs b/Scripts/Spells/Base/Spell.cs
index eec45b17a..97606c81f 100644
--- a/Scripts/Spells/Base/Spell.cs
+++ b/Scripts/Spells/Base/Spell.cs
@@ -118,7 +118,7 @@ namespace Server.Spells
return true;
}
- public virtual bool OnCasterUsingObject(object o)
+ public virtual bool OnCasterUsingObject(IEntity entity)
{
if (State == SpellState.Sequencing)
Disturb(DisturbType.UseRequest);
diff --git a/Scripts/Spells/Third/Telekinesis.cs b/Scripts/Spells/Third/Telekinesis.cs
index 086682034..67b094a9c 100644
--- a/Scripts/Spells/Third/Telekinesis.cs
+++ b/Scripts/Spells/Third/Telekinesis.cs
@@ -42,8 +42,6 @@ namespace Server.Spells.Third
{
SpellHelper.Turn(Caster, item);
- object root = item.RootParent;
-
if (!item.IsAccessibleTo(Caster))
{
item.OnDoubleClickNotAccessible(Caster);
@@ -51,7 +49,7 @@ namespace Server.Spells.Third
else if (!item.CheckItemUse(Caster, item))
{
}
- else if (root is Mobile && root != Caster)
+ else if (item.RootParent is Mobile && item.RootParent != Caster)
{
item.OnSnoop(Caster);
}
@@ -104,4 +102,4 @@ namespace Server
{
void OnTelekinesis(Mobile from);
}
-}
\ No newline at end of file
+}
diff --git a/Server/Interfaces.cs b/Server/Interfaces.cs
index 24a855285..b1a06178b 100644
--- a/Server/Interfaces.cs
+++ b/Server/Interfaces.cs
@@ -84,7 +84,7 @@ namespace Server
void OnConnectionChanged();
bool OnCasterMoving(Direction d);
bool OnCasterEquipping(Item item);
- bool OnCasterUsingObject(object o);
+ bool OnCasterUsingObject(IEntity entity);
bool OnCastInTown(Region r);
}
@@ -111,4 +111,4 @@ namespace Server
void OnBeforeSpawn(Point3D location, Map map);
void OnAfterSpawn();
}
-}
\ No newline at end of file
+}
diff --git a/Server/Item.cs b/Server/Item.cs
index 68edab5ee..6f975d680 100644
--- a/Server/Item.cs
+++ b/Server/Item.cs
@@ -3681,15 +3681,13 @@ namespace Server
target.Map == null)
return false;
- object root = target.RootParent;
-
if (from.AccessLevel < AccessLevel.GameMaster && !from.InRange(target.GetWorldLocation(), 2))
return false;
if (!from.CanSee(target) || !from.InLOS(target))
return false;
if (!target.IsAccessibleTo(from))
return false;
- if (root is Mobile mobile && !mobile.CheckNonlocalDrop(from, this, target))
+ if (target.RootParent is Mobile mobile && !mobile.CheckNonlocalDrop(from, this, target))
return false;
if (!from.OnDroppedItemToItem(this, target, p))
return false;
@@ -4290,11 +4288,6 @@ namespace Server
Delete();
}
- public virtual bool CheckBlessed(object obj)
- {
- return CheckBlessed(obj as Mobile);
- }
-
public virtual bool CheckBlessed(Mobile m)
{
if (m_LootType == LootType.Blessed || Mobile.InsuranceEnabled && Insured)
diff --git a/Server/Items/Container.cs b/Server/Items/Container.cs
index cb6a6c8e3..aaa0966cb 100644
--- a/Server/Items/Container.cs
+++ b/Server/Items/Container.cs
@@ -233,7 +233,7 @@ namespace Server.Items
}
}
- object parent = Parent;
+ IEntity parent = Parent;
while (parent != null)
{
@@ -627,15 +627,9 @@ namespace Server.Items
public virtual bool CheckContentDisplay(Mobile from)
{
- if (DisplaysContent)
- {
- object root = RootParent;
-
- if (root == null || root is Item || root == from || from.AccessLevel > AccessLevel.Player)
- return true;
- }
-
- return false;
+ return DisplaysContent && RootParent == null ||
+ RootParent is Item || RootParent == from ||
+ from.AccessLevel > AccessLevel.Player;
}
public override void OnSingleClick(Mobile from)
diff --git a/Server/Mobile.cs b/Server/Mobile.cs
index ec94cccc1..44f434a62 100644
--- a/Server/Mobile.cs
+++ b/Server/Mobile.cs
@@ -4667,7 +4667,7 @@ namespace Server
if (m_Spell != null && !m_Spell.OnCasterUsingObject(item))
return;
- object root = item.RootParent;
+ IEntity root = item.RootParent;
bool okay = false;
if (!Utility.InUpdateRange(this, item.GetWorldLocation()))
@@ -4789,7 +4789,7 @@ namespace Server
}
else
{
- object root = item.RootParent;
+ IEntity root = item.RootParent;
if (root is Mobile mobile && !mobile.CheckNonlocalLift(from, item))
{
@@ -4964,7 +4964,7 @@ namespace Server
if (DragEffects && !item.Deleted)
{
Map map = m_Map;
- object root = item.RootParent;
+ IEntity root = item.RootParent;
if (map != null && (root == null || root is Item))
{
diff --git a/Server/NativeReader.cs b/Server/NativeReader.cs
index 788d9d951..d1d8ccf5d 100644
--- a/Server/NativeReader.cs
+++ b/Server/NativeReader.cs
@@ -56,7 +56,7 @@ namespace Server
UnsafeNativeMethods.ReadFile(ptr, buffer, (uint)length, ref lpNumberOfBytesRead, null);
}
- internal class UnsafeNativeMethods
+ internal static class UnsafeNativeMethods
{
/*[DllImport("kernel32")]
internal unsafe static extern int _lread(IntPtr hFile, void* lpBuffer, int wBytes);*/
@@ -74,10 +74,10 @@ namespace Server
UnsafeNativeMethods.read(ptr, buffer, length);
}
- internal class UnsafeNativeMethods
+ internal static class UnsafeNativeMethods
{
[DllImport("libc")]
internal static extern unsafe int read(IntPtr ptr, void* buffer, int length);
}
}
-}
\ No newline at end of file
+}
diff --git a/Server/Targeting/Target.cs b/Server/Targeting/Target.cs
index 9df06fba1..64c209ada 100644
--- a/Server/Targeting/Target.cs
+++ b/Server/Targeting/Target.cs
@@ -165,9 +165,7 @@ namespace Server.Targeting
return;
}
- object root = item.RootParent;
-
- if (!AllowNonlocal && root is Mobile && root != from && from.AccessLevel == AccessLevel.Player)
+ if (!AllowNonlocal && item.RootParent is Mobile && item.RootParent != from && from.AccessLevel == AccessLevel.Player)
{
OnNonlocalTarget(from, item);
OnTargetFinish(from);
@@ -290,4 +288,4 @@ namespace Server.Targeting
}
}
}
-}
\ No newline at end of file
+}
From 1c8f044476f1ef977ac80e3cf451dd08bc5b5d50 Mon Sep 17 00:00:00 2001
From: Kamron Batman
Date: Sun, 3 Mar 2019 15:49:10 -0800
Subject: [PATCH 6/7] Fixes mono builds. (#16)
---
Scripts/Engines/RemoteAdmin/Network.cs | 5 +----
Server/NativeReader.cs | 1 -
Server/Persistence/FileOperations.cs | 7 ++++---
Server/Persistence/SaveMetrics.cs | 4 +---
Server/TileMatrix.cs | 12 ++----------
Server/TileMatrixPatch.cs | 10 +---------
6 files changed, 9 insertions(+), 30 deletions(-)
diff --git a/Scripts/Engines/RemoteAdmin/Network.cs b/Scripts/Engines/RemoteAdmin/Network.cs
index 16ee46cc3..09e9cd300 100644
--- a/Scripts/Engines/RemoteAdmin/Network.cs
+++ b/Scripts/Engines/RemoteAdmin/Network.cs
@@ -22,10 +22,7 @@ namespace Server.RemoteAdmin
public static void Configure()
{
PacketHandlers.Register(0xF1, 0, false, OnReceive);
-
-#if !MONO
Core.MultiConsoleOut.Add(new EventTextWriter(OnConsoleChar, OnConsoleLine, OnConsoleString));
-#endif
Timer.DelayCall(TimeSpan.FromMinutes(2.5), TimeSpan.FromMinutes(2.5), CleanUp);
}
@@ -279,4 +276,4 @@ namespace Server.RemoteAdmin
m_OnLine?.Invoke(line);
}
}
-}
\ No newline at end of file
+}
diff --git a/Server/NativeReader.cs b/Server/NativeReader.cs
index d1d8ccf5d..c561a051b 100644
--- a/Server/NativeReader.cs
+++ b/Server/NativeReader.cs
@@ -51,7 +51,6 @@ namespace Server
{
public unsafe void Read(IntPtr ptr, void* buffer, int length)
{
- //UnsafeNativeMethods._lread( ptr, buffer, length );
uint lpNumberOfBytesRead = 0;
UnsafeNativeMethods.ReadFile(ptr, buffer, (uint)length, ref lpNumberOfBytesRead, null);
}
diff --git a/Server/Persistence/FileOperations.cs b/Server/Persistence/FileOperations.cs
index 2d484d849..774d91503 100644
--- a/Server/Persistence/FileOperations.cs
+++ b/Server/Persistence/FileOperations.cs
@@ -48,10 +48,11 @@ namespace Server
{
FileOptions options = FileOptions.SequentialScan;
- if (Concurrency > 0) options |= FileOptions.Asynchronous;
+ if (Concurrency > 0)
+ options |= FileOptions.Asynchronous;
#if MONO
- return new FileStream( path, mode, access, share, bufferSize, options );
+ return new FileStream( path, mode, access, share, BufferSize, options );
#else
if (Unbuffered)
options |= NoBuffering;
@@ -109,4 +110,4 @@ namespace Server
}
#endif
}
-}
\ No newline at end of file
+}
diff --git a/Server/Persistence/SaveMetrics.cs b/Server/Persistence/SaveMetrics.cs
index 0ee2136d6..b1384ffde 100644
--- a/Server/Persistence/SaveMetrics.cs
+++ b/Server/Persistence/SaveMetrics.cs
@@ -79,10 +79,8 @@ namespace Server
)
);
-#if !MONO
PerformanceCounterCategory.Create(PerformanceCategoryName, PerformanceCategoryDesc,
PerformanceCounterCategoryType.SingleInstance, counters);
-#endif
}
numberOfWorldSaves = new PerformanceCounter(PerformanceCategoryName, "Save - Count", false);
@@ -137,4 +135,4 @@ namespace Server
writtenBytesPerSecond.IncrementBy(numberOfBytes);
}
}
-}
\ No newline at end of file
+}
diff --git a/Server/TileMatrix.cs b/Server/TileMatrix.cs
index 03aa5e192..b96bfbf1b 100644
--- a/Server/TileMatrix.cs
+++ b/Server/TileMatrix.cs
@@ -388,11 +388,7 @@ namespace Server
fixed (StaticTile* pTiles = staTiles)
{
-#if !MONO
NativeReader.Read(DataStream.SafeFileHandle.DangerousGetHandle(), pTiles, length);
-#else
- NativeReader.Read( m_Statics.Handle, pTiles, length );
-#endif
if (m_Lists == null)
{
m_Lists = new TileList[8][];
@@ -463,11 +459,7 @@ namespace Server
fixed (LandTile* pTiles = tiles)
{
-#if !MONO
NativeReader.Read(MapStream.SafeFileHandle.DangerousGetHandle(), pTiles, 192);
-#else
- NativeReader.Read( m_Map.Handle, pTiles, 192 );
-#endif
}
return tiles;
@@ -718,9 +710,9 @@ namespace Server
if (y == null)
return -1;
-
+
return x.m_Offset.CompareTo(y.m_Offset);
}
}
}
-}
\ No newline at end of file
+}
diff --git a/Server/TileMatrixPatch.cs b/Server/TileMatrixPatch.cs
index cff17809f..aeea0e751 100644
--- a/Server/TileMatrixPatch.cs
+++ b/Server/TileMatrixPatch.cs
@@ -95,11 +95,7 @@ namespace Server
fixed (LandTile* pTiles = tiles)
{
-#if !MONO
NativeReader.Read(fsData.SafeFileHandle.DangerousGetHandle(), pTiles, 192);
-#else
- NativeReader.Read( fsData.Handle, pTiles, 192 );
-#endif
}
matrix.SetLandBlock(x, y, tiles);
@@ -163,11 +159,7 @@ namespace Server
fixed (StaticTile* pTiles = staTiles)
{
-#if !MONO
NativeReader.Read(fsData.SafeFileHandle.DangerousGetHandle(), pTiles, length);
-#else
- NativeReader.Read( fsData.Handle, pTiles, length );
-#endif
StaticTile* pCur = pTiles, pEnd = pTiles + tileCount;
while (pCur < pEnd)
@@ -199,4 +191,4 @@ namespace Server
}
}
}
-}
\ No newline at end of file
+}
From 0fb73bdc3514b900ed2d436ab8eadb17a6945c56 Mon Sep 17 00:00:00 2001
From: Kamron Batman
Date: Tue, 5 Mar 2019 16:00:06 -0800
Subject: [PATCH 7/7] Updates GOALS.md
---
GOALS.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/GOALS.md b/GOALS.md
index 2b08b1089..19ff4152e 100644
--- a/GOALS.md
+++ b/GOALS.md
@@ -44,7 +44,7 @@
- [ ] Naked corpses (container display issue)
- [X] Rounding errors with new bank system
- [ ] Replace `double` with `int` for skills to fix rounding errors and optimize code
-- [ ] Replace specific checks for `Item`/`Mobile` by extended `IEntity` and mainstreaming the `NEWPARENT` code
+- [X] Replace specific checks for `Item`/`Mobile` by extended `IEntity` and mainstreaming the `NEWPARENT` code
- [ ] TryDropItem dropping items until it fails when it should be all-or-nothing
- [ ] Consuming items are deleted directly in several places instead of using `Item.Consume()`
- [ ] Content displaying for newer clients is not working properly in several situations