Dynamic resupply check (#6338)

This commit is contained in:
Matthew Peng
2021-11-15 06:27:22 -08:00
committed by GitHub
parent d23813f328
commit 4a7774fe5a
2 changed files with 5 additions and 1 deletions

View File

@@ -434,6 +434,10 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
return block.unloadable;
}
public boolean canResupply(){
return block.allowResupply;
}
public boolean payloadCheck(int conveyorRotation){
return block.rotate && (rotation + 2) % 4 == conveyorRotation;
}

View File

@@ -46,7 +46,7 @@ public class ItemAmmoType implements AmmoType{
float range = unit.hitSize + this.range;
Building build = Units.closestBuilding(unit.team, unit.x, unit.y, range, u -> u.block.allowResupply && u.items.has(item));
Building build = Units.closestBuilding(unit.team, unit.x, unit.y, range, u -> u.canResupply() && u.items.has(item));
if(build != null){
Fx.itemTransfer.at(build.x, build.y, ammoPerItem / 2f, item.color, unit);