SteamWar/FightSystem
Archiviert
13
1

Fix HellsBells distribution

Dieser Commit ist enthalten in:
yoyosource 2021-06-26 17:16:29 +02:00
Ursprung b7520abb1b
Commit 3ae18ab0b8

Datei anzeigen

@ -114,7 +114,7 @@ public class HellsBells {
private int getStart(int regionSize, int length) { private int getStart(int regionSize, int length) {
double randomNumber = (random.nextDouble() - random.nextDouble()) / 2 + 0.5; double randomNumber = (random.nextDouble() - random.nextDouble()) / 2 + 0.5;
return (int) (randomNumber * (regionSize - length)); return Math.max(Math.min((int) (randomNumber * (regionSize - length)), regionSize - length), 0);
} }
private int getHeightStart() { private int getHeightStart() {