From 86b63f003df6932ea31e903d3b70a65d3bc2a901 Mon Sep 17 00:00:00 2001 From: Kamron Batman <3953314+kamronbatman@users.noreply.github.com> Date: Thu, 13 Sep 2018 23:30:04 -0700 Subject: [PATCH] Fixes unreachable code in Map --- Server/Map.cs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/Server/Map.cs b/Server/Map.cs index 1dc57be9c..7d3161c75 100644 --- a/Server/Map.cs +++ b/Server/Map.cs @@ -548,8 +548,11 @@ namespace Server surface = id.Surface; impassable = id.Impassable; - return !((surface || impassable) && staticTiles[i].Z + id.CalcHeight > z && z + height > staticTiles[i].Z) - || surface && !impassable && z == staticTiles[i].Z + id.CalcHeight; + if ( ( surface || impassable ) && ( staticTiles[i].Z + id.CalcHeight ) > z && ( z + height ) > staticTiles[i].Z ) + return false; + + if ( surface && !impassable && z == ( staticTiles[i].Z + id.CalcHeight ) ) + hasSurface = true; } Sector sector = GetSector( x, y ); @@ -566,8 +569,11 @@ namespace Server surface = id.Surface; impassable = id.Impassable; - return !((surface || impassable || checkBlocksFit && item.BlocksFit) && item.Z + id.CalcHeight > z && z + height > item.Z) - || surface && !impassable && !item.Movable && z == item.Z + id.CalcHeight; + if ( ( surface || impassable || ( checkBlocksFit && item.BlocksFit ) ) && ( item.Z + id.CalcHeight ) > z && ( z + height ) > item.Z ) + return false; + + if ( surface && !impassable && !item.Movable && z == ( item.Z + id.CalcHeight ) ) + hasSurface = true; } }