Crash fix

This commit is contained in:
Anuken 2019-05-03 10:26:56 -04:00
parent a161c09441
commit 4b9bcfb014
2 changed files with 3 additions and 2 deletions

View File

@ -224,7 +224,7 @@ public class Saves{
}
public Zone getZone(){
return content.getByID(ContentType.zone, meta.rules.zone);
return meta == null || meta.rules == null ? null : content.getByID(ContentType.zone, meta.rules.zone);
}
public int getBuild(){

View File

@ -161,7 +161,7 @@ public class UnitFactory extends Block{
//player-made spawners have default behavior
if(entity.cons.valid() || tile.isEnemyCheat()){
entity.time += entity.delta() * entity.speedScl * Vars.state.rules.unitBuildSpeedMultiplier;
entity.time += entity.delta() * entity.speedScl * Vars.state.rules.unitBuildSpeedMultiplier * entity.power.satisfaction;
entity.buildTime += entity.delta() * entity.power.satisfaction * Vars.state.rules.unitBuildSpeedMultiplier;
entity.speedScl = Mathf.lerpDelta(entity.speedScl, 1f, 0.05f);
}else{
@ -199,6 +199,7 @@ public class UnitFactory extends Block{
float buildTime;
float time;
float speedScl;
//TODO remove next breaking release
float warmup; //only for enemy spawners
int spawned;