hortiloader hotfix (#6248)

Added an offset so they cycle through all buildings having the same load
This commit is contained in:
hortiSquash
2021-10-28 10:01:05 -04:00
committed by GitHub
parent 09f718ba3d
commit 10f2a7b59c
@@ -85,8 +85,9 @@ public class Unloader extends Block{
if(sortItem != null){ if(sortItem != null){
item = sortItem; item = sortItem;
for(int pos = 0; pos < proximity.size; pos++){ for(int j = 0; j < proximity.size; j++){
var other = proximity.get(pos); int pos = (offset + j) % proximity.size;
var other = proximity.get(j);
boolean interactable = other.interactable(team); boolean interactable = other.interactable(team);
//set the stats of all buildings in possibleBlocks //set the stats of all buildings in possibleBlocks
@@ -105,8 +106,9 @@ public class Unloader extends Block{
boolean isDistinct = false; boolean isDistinct = false;
Item possibleItem = content.item(total); Item possibleItem = content.item(total);
for(int pos = 0; pos < proximity.size; pos++){ for(int j = 0; j < proximity.size; j++){
var other = proximity.get(pos); int pos = (offset + j) % proximity.size;
var other = proximity.get(j);
boolean interactable = other.interactable(team); boolean interactable = other.interactable(team);
//set the stats of all buildings in possibleBlocks while we are at it //set the stats of all buildings in possibleBlocks while we are at it