SteamWar/BauSystem2.0
Archiviert
12
0

Fix edge case for slot 0
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Signed-off-by: yoyosource <yoyosource@nidido.de>
Dieser Commit ist enthalten in:
yoyosource 2022-08-28 16:59:33 +02:00
Ursprung 549baedf4d
Commit 776dd84668

Datei anzeigen

@ -74,9 +74,13 @@ public class InventoryFiller implements Listener {
if (lowerBound < 0) lowerBound += 8;
int direction = 0;
if (event.getNewSlot() > event.getPreviousSlot() || event.getNewSlot() < upperBound) {
if (event.getPreviousSlot() != 0 && (event.getNewSlot() > event.getPreviousSlot() || (upperBound < event.getPreviousSlot() && event.getNewSlot() < upperBound))) {
direction = 1;
} else if (event.getPreviousSlot() == 0 && event.getNewSlot() > upperBound) {
direction = -1;
} else if (event.getNewSlot() < event.getPreviousSlot() || event.getNewSlot() >= lowerBound) {
} else if (event.getNewSlot() < event.getPreviousSlot() || (lowerBound > event.getPreviousSlot() && event.getNewSlot() >= lowerBound)) {
direction = -1;
} else if (event.getPreviousSlot() == 0) {
direction = 1;
}