Crash fixes

This commit is contained in:
Anuken
2018-11-28 08:53:03 -05:00
parent cc90e6d479
commit f2be23274e
11 changed files with 30 additions and 14 deletions

View File

@@ -1,5 +1,6 @@
package io.anuke.mindustry.entities.traits;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.utils.Queue;
import io.anuke.mindustry.Vars;
@@ -229,7 +230,7 @@ public interface BuilderTrait extends Entity{
}
if(!current.initialized){
Events.fire(new BuildSelectEvent(tile, unit.getTeam(), this, current.breaking));
Gdx.app.postRunnable(() -> Events.fire(new BuildSelectEvent(tile, unit.getTeam(), this, current.breaking)));
current.initialized = true;
}
}

View File

@@ -97,7 +97,7 @@ public abstract class BaseUnit extends Unit implements ShooterTrait{
}
public boolean isCommanded(){
return !isWave && world.indexer.getAllied(team, BlockFlag.comandCenter).size != 0;
return !isWave && world.indexer.getAllied(team, BlockFlag.comandCenter).size != 0 && world.indexer.getAllied(team, BlockFlag.comandCenter).first().entity instanceof CommandCenterEntity;
}
public UnitCommand getCommand(){

View File

@@ -41,7 +41,7 @@ public class UnitType extends UnlockableContent{
public float carryWeight = 1f;
public int itemCapacity = 30;
public ObjectSet<Item> toMine = ObjectSet.with(Items.lead, Items.copper);
public float buildPower = 0.3f, minePower = 0.7f, healSpeed = 2f;
public float buildPower = 0.3f, minePower = 0.7f;
public Weapon weapon = Weapons.blaster;
public float weaponOffsetX, weaponOffsetY;
public Color trailColor = Color.valueOf("ffa665");