This commit is contained in:
Anuken
2021-08-28 08:44:42 -04:00
parent 6ca2855365
commit 4d62b0321f
2 changed files with 5 additions and 2 deletions

View File

@@ -39,12 +39,15 @@ public class UnitFactory extends UnitBlock{
rotate = true;
config(Integer.class, (UnitFactoryBuild tile, Integer i) -> {
if(tile.currentPlan == i) return;
tile.currentPlan = i < 0 || i >= plans.size ? -1 : i;
tile.progress = 0;
});
config(UnitType.class, (UnitFactoryBuild tile, UnitType val) -> {
tile.currentPlan = plans.indexOf(p -> p.unit == val);
int next = plans.indexOf(p -> p.unit == val);
if(tile.currentPlan == next) return;
tile.currentPlan = next;
tile.progress = 0;
});