From 580da8a0cc699b97678598a717438dd63dd0898f Mon Sep 17 00:00:00 2001 From: Kamron Batman <3953314+kamronbatman@users.noreply.github.com> Date: Wed, 16 Sep 2020 22:13:02 -0700 Subject: [PATCH] Reverts a weird change that should never have happened (#255) - [X] Reverts CheckHouse to fix an NPE in CouldFit Bumps release --- Projects/UOContent/Items/Addons/BaseAddon.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Projects/UOContent/Items/Addons/BaseAddon.cs b/Projects/UOContent/Items/Addons/BaseAddon.cs index c4329f856..3b9bd4161 100644 --- a/Projects/UOContent/Items/Addons/BaseAddon.cs +++ b/Projects/UOContent/Items/Addons/BaseAddon.cs @@ -204,8 +204,12 @@ namespace Server.Items return AddonFitResult.Valid; } - public static bool CheckHouse(Mobile from, Point3D p, Map map, int height, ref BaseHouse house) => - from == null || BaseHouse.FindHouseAt(p, map, height)?.IsOwner(from) == true; + public static bool CheckHouse(Mobile from, Point3D p, Map map, int height, ref BaseHouse house) + { + house = BaseHouse.FindHouseAt(p, map, height); + + return house != null && (from == null || house.IsOwner(from)); + } public static bool IsWall(int x, int y, int z, Map map) {