Reorder the logic of cake wars islands.
This commit is contained in:
parent
2d51daaa63
commit
155fabb9e9
@ -240,15 +240,14 @@ public class CakeIslandModule extends CakeModule
|
||||
|
||||
private Location getRandomLocation()
|
||||
{
|
||||
Location location = null;
|
||||
int attempts = 0;
|
||||
List<Player> alive = _game.GetPlayers(true);
|
||||
|
||||
attemptsLoop:
|
||||
while (location == null)
|
||||
while (attempts < MAX_ATTEMPTS)
|
||||
{
|
||||
attempts++;
|
||||
location = UtilAlg.getRandomLocation(_center, MAX_XZ, 0, MAX_XZ);
|
||||
Location location = UtilAlg.getRandomLocation(_center, MAX_XZ, 0, MAX_XZ);
|
||||
Chunk chunk = location.getChunk();
|
||||
|
||||
// Prevent islands spawning inside other blocks
|
||||
@ -269,15 +268,10 @@ public class CakeIslandModule extends CakeModule
|
||||
}
|
||||
}
|
||||
|
||||
if (attempts >= MAX_ATTEMPTS)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
break;
|
||||
return location;
|
||||
}
|
||||
|
||||
return location;
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user