From e2efcc41700781300e93cfe7899113107b3b3f81 Mon Sep 17 00:00:00 2001 From: MobiusDev <8391001+MobiusDevelopment@users.noreply.github.com> Date: Tue, 26 Sep 2017 21:37:19 +0000 Subject: [PATCH] Small refactoring for previous commit. --- .../java/com/l2jmobius/gameserver/geoengine/GeoEngine.java | 7 +++---- .../java/com/l2jmobius/gameserver/geoengine/GeoEngine.java | 7 +++---- .../java/com/l2jmobius/gameserver/geoengine/GeoEngine.java | 7 +++---- .../java/com/l2jmobius/gameserver/geoengine/GeoEngine.java | 7 +++---- .../java/com/l2jmobius/gameserver/geoengine/GeoEngine.java | 7 +++---- 5 files changed, 15 insertions(+), 20 deletions(-) diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/geoengine/GeoEngine.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/geoengine/GeoEngine.java index 0239b756cd..31507ff1d2 100644 --- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/geoengine/GeoEngine.java +++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/geoengine/GeoEngine.java @@ -273,12 +273,11 @@ public class GeoEngine final int y = geoY / GeoStructure.BLOCK_CELLS_Y; // if x or y is out of array return null - if ((x >= GeoStructure.GEO_BLOCKS_X) || (y >= GeoStructure.GEO_BLOCKS_Y)) + if ((x < GeoStructure.GEO_BLOCKS_X) && (y < GeoStructure.GEO_BLOCKS_Y)) { - return null; + return _blocks[x][y]; } - - return _blocks[x][y]; + return null; } /** diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/geoengine/GeoEngine.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/geoengine/GeoEngine.java index 0239b756cd..31507ff1d2 100644 --- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/geoengine/GeoEngine.java +++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/geoengine/GeoEngine.java @@ -273,12 +273,11 @@ public class GeoEngine final int y = geoY / GeoStructure.BLOCK_CELLS_Y; // if x or y is out of array return null - if ((x >= GeoStructure.GEO_BLOCKS_X) || (y >= GeoStructure.GEO_BLOCKS_Y)) + if ((x < GeoStructure.GEO_BLOCKS_X) && (y < GeoStructure.GEO_BLOCKS_Y)) { - return null; + return _blocks[x][y]; } - - return _blocks[x][y]; + return null; } /** diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/geoengine/GeoEngine.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/geoengine/GeoEngine.java index 0239b756cd..31507ff1d2 100644 --- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/geoengine/GeoEngine.java +++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/geoengine/GeoEngine.java @@ -273,12 +273,11 @@ public class GeoEngine final int y = geoY / GeoStructure.BLOCK_CELLS_Y; // if x or y is out of array return null - if ((x >= GeoStructure.GEO_BLOCKS_X) || (y >= GeoStructure.GEO_BLOCKS_Y)) + if ((x < GeoStructure.GEO_BLOCKS_X) && (y < GeoStructure.GEO_BLOCKS_Y)) { - return null; + return _blocks[x][y]; } - - return _blocks[x][y]; + return null; } /** diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/geoengine/GeoEngine.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/geoengine/GeoEngine.java index 26ab234a48..c829a28d26 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/geoengine/GeoEngine.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/geoengine/GeoEngine.java @@ -271,12 +271,11 @@ public class GeoEngine final int y = geoY / GeoStructure.BLOCK_CELLS_Y; // if x or y is out of array return null - if ((x >= GeoStructure.GEO_BLOCKS_X) || (y >= GeoStructure.GEO_BLOCKS_Y)) + if ((x < GeoStructure.GEO_BLOCKS_X) && (y < GeoStructure.GEO_BLOCKS_Y)) { - return null; + return _blocks[x][y]; } - - return _blocks[x][y]; + return null; } /** diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/geoengine/GeoEngine.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/geoengine/GeoEngine.java index 0239b756cd..31507ff1d2 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/geoengine/GeoEngine.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/geoengine/GeoEngine.java @@ -273,12 +273,11 @@ public class GeoEngine final int y = geoY / GeoStructure.BLOCK_CELLS_Y; // if x or y is out of array return null - if ((x >= GeoStructure.GEO_BLOCKS_X) || (y >= GeoStructure.GEO_BLOCKS_Y)) + if ((x < GeoStructure.GEO_BLOCKS_X) && (y < GeoStructure.GEO_BLOCKS_Y)) { - return null; + return _blocks[x][y]; } - - return _blocks[x][y]; + return null; } /**