Unit cargo transport system
This commit is contained in:
@@ -785,17 +785,19 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
|
||||
}
|
||||
|
||||
/** Dumps any item with an accumulator. May dump multiple times per frame. Use with care. */
|
||||
public void dumpAccumulate(){
|
||||
dumpAccumulate(null);
|
||||
public boolean dumpAccumulate(){
|
||||
return dumpAccumulate(null);
|
||||
}
|
||||
|
||||
/** Dumps any item with an accumulator. May dump multiple times per frame. Use with care. */
|
||||
public void dumpAccumulate(Item item){
|
||||
public boolean dumpAccumulate(Item item){
|
||||
boolean res = false;
|
||||
dumpAccum += delta();
|
||||
while(dumpAccum >= 1f){
|
||||
dump(item);
|
||||
res |= dump(item);
|
||||
dumpAccum -=1f;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
/** Try dumping any item near the building. */
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package mindustry.entities.comp;
|
||||
|
||||
import arc.util.*;
|
||||
import mindustry.annotations.Annotations.*;
|
||||
import mindustry.game.*;
|
||||
import mindustry.gen.*;
|
||||
@@ -11,7 +12,7 @@ abstract class BuildingTetherComp implements Unitc{
|
||||
@Import UnitType type;
|
||||
@Import Team team;
|
||||
|
||||
public Building building;
|
||||
public @Nullable Building building;
|
||||
|
||||
@Override
|
||||
public void update(){
|
||||
|
||||
Reference in New Issue
Block a user