Skip to content

Commit

Permalink
Fixed errors when entering portals not inside an island (#1887)
Browse files Browse the repository at this point in the history
  • Loading branch information
OmerBenGera committed Sep 25, 2023
1 parent 90c3e33 commit a08a843
Showing 1 changed file with 3 additions and 0 deletions.
Expand Up @@ -136,6 +136,9 @@ private EntityPortalResult simulateEntityPortal(Entity entity, Location portalLo
Location destinationPortalLocation) {
Island island = plugin.getGrid().getIslandAt(portalLocation);

if (island == null)
return EntityPortalResult.PORTAL_NOT_IN_ISLAND;

EntityPortalResult entityPortalResult = simulateEntityPortalFromIsland(entity, island, portalLocation, portalType);
if (entityPortalResult != EntityPortalResult.SUCCEED)
return entityPortalResult;
Expand Down

0 comments on commit a08a843

Please sign in to comment.