Probable getBlock array index out of bounds NPE fix.

This commit is contained in:
MobiusDevelopment 2019-05-16 23:44:03 +00:00
parent d048eb9816
commit 77e5379d97
14 changed files with 14 additions and 14 deletions

View File

@ -274,7 +274,7 @@ 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 > -1) && (y > -1) && (x < GeoStructure.GEO_BLOCKS_X) && (y < GeoStructure.GEO_BLOCKS_Y))
{
return _blocks[x][y];
}

View File

@ -274,7 +274,7 @@ 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 > -1) && (y > -1) && (x < GeoStructure.GEO_BLOCKS_X) && (y < GeoStructure.GEO_BLOCKS_Y))
{
return _blocks[x][y];
}

View File

@ -274,7 +274,7 @@ 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 > -1) && (y > -1) && (x < GeoStructure.GEO_BLOCKS_X) && (y < GeoStructure.GEO_BLOCKS_Y))
{
return _blocks[x][y];
}

View File

@ -274,7 +274,7 @@ 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 > -1) && (y > -1) && (x < GeoStructure.GEO_BLOCKS_X) && (y < GeoStructure.GEO_BLOCKS_Y))
{
return _blocks[x][y];
}

View File

@ -274,7 +274,7 @@ 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 > -1) && (y > -1) && (x < GeoStructure.GEO_BLOCKS_X) && (y < GeoStructure.GEO_BLOCKS_Y))
{
return _blocks[x][y];
}

View File

@ -274,7 +274,7 @@ 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 > -1) && (y > -1) && (x < GeoStructure.GEO_BLOCKS_X) && (y < GeoStructure.GEO_BLOCKS_Y))
{
return _blocks[x][y];
}

View File

@ -274,7 +274,7 @@ 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 > -1) && (y > -1) && (x < GeoStructure.GEO_BLOCKS_X) && (y < GeoStructure.GEO_BLOCKS_Y))
{
return _blocks[x][y];
}

View File

@ -272,7 +272,7 @@ 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 > -1) && (y > -1) && (x < GeoStructure.GEO_BLOCKS_X) && (y < GeoStructure.GEO_BLOCKS_Y))
{
return _blocks[x][y];
}

View File

@ -272,7 +272,7 @@ 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 > -1) && (y > -1) && (x < GeoStructure.GEO_BLOCKS_X) && (y < GeoStructure.GEO_BLOCKS_Y))
{
return _blocks[x][y];
}

View File

@ -274,7 +274,7 @@ 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 > -1) && (y > -1) && (x < GeoStructure.GEO_BLOCKS_X) && (y < GeoStructure.GEO_BLOCKS_Y))
{
return _blocks[x][y];
}

View File

@ -274,7 +274,7 @@ 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 > -1) && (y > -1) && (x < GeoStructure.GEO_BLOCKS_X) && (y < GeoStructure.GEO_BLOCKS_Y))
{
return _blocks[x][y];
}

View File

@ -274,7 +274,7 @@ 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 > -1) && (y > -1) && (x < GeoStructure.GEO_BLOCKS_X) && (y < GeoStructure.GEO_BLOCKS_Y))
{
return _blocks[x][y];
}

View File

@ -274,7 +274,7 @@ 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 > -1) && (y > -1) && (x < GeoStructure.GEO_BLOCKS_X) && (y < GeoStructure.GEO_BLOCKS_Y))
{
return _blocks[x][y];
}

View File

@ -274,7 +274,7 @@ 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 > -1) && (y > -1) && (x < GeoStructure.GEO_BLOCKS_X) && (y < GeoStructure.GEO_BLOCKS_Y))
{
return _blocks[x][y];
}