Fixed smelter not using items, unit factory recipe

This commit is contained in:
Anuken
2018-06-25 15:44:09 -04:00
parent 92a748a762
commit ced11c88bc
5 changed files with 50 additions and 19 deletions
@@ -21,6 +21,7 @@ import io.anuke.mindustry.net.Net;
import io.anuke.mindustry.type.AmmoType;
import io.anuke.mindustry.type.Item;
import io.anuke.mindustry.world.Tile;
import io.anuke.mindustry.world.blocks.units.UnitFactory.UnitFactoryEntity;
import io.anuke.mindustry.world.meta.BlockFlag;
import io.anuke.ucore.core.Effects;
import io.anuke.ucore.core.Timers;
@@ -52,12 +53,17 @@ public abstract class BaseUnit extends Unit{
protected boolean isWave;
protected Squad squad;
protected UnitFactoryEntity spawner;
public BaseUnit(UnitType type, Team team){
this.type = type;
this.team = team;
}
public void setSpawner(UnitFactoryEntity spawner) {
this.spawner = spawner;
}
public UnitType getType() {
return type;
}
@@ -259,6 +265,14 @@ public abstract class BaseUnit extends Unit{
}
@Override
public void removed() {
if(spawner != null){
spawner.hasSpawned = false;
spawner = null;
}
}
@Override
public float drawSize(){
return 14;