Visible object list should be empty and not null.

This commit is contained in:
MobiusDevelopment
2020-09-01 13:13:26 +00:00
parent a16386a5fa
commit a798e88a35
2 changed files with 6 additions and 6 deletions

View File

@@ -467,15 +467,15 @@ public class World
*/ */
public List<WorldObject> getVisibleObjects(WorldObject object) public List<WorldObject> getVisibleObjects(WorldObject object)
{ {
if (object == null) if ((object == null) || !object.isSpawned())
{ {
return null; return Collections.emptyList();
} }
final WorldRegion region = object.getWorldRegion(); final WorldRegion region = object.getWorldRegion();
if (region == null) if (region == null)
{ {
return null; return Collections.emptyList();
} }
// Create a list in order to contain all visible WorldObject // Create a list in order to contain all visible WorldObject

View File

@@ -467,15 +467,15 @@ public class World
*/ */
public List<WorldObject> getVisibleObjects(WorldObject object) public List<WorldObject> getVisibleObjects(WorldObject object)
{ {
if (object == null) if ((object == null) || !object.isSpawned())
{ {
return null; return Collections.emptyList();
} }
final WorldRegion region = object.getWorldRegion(); final WorldRegion region = object.getWorldRegion();
if (region == null) if (region == null)
{ {
return null; return Collections.emptyList();
} }
// Create a list in order to contain all visible WorldObject // Create a list in order to contain all visible WorldObject