From 305e2642ba3851865cc38b524a9d3716fd9039f0 Mon Sep 17 00:00:00 2001 From: Anuken Date: Tue, 1 Dec 2020 12:48:26 -0500 Subject: [PATCH] Minor bugfixes --- core/src/mindustry/entities/bullet/BulletType.java | 3 ++- core/src/mindustry/io/TypeIO.java | 2 +- core/src/mindustry/maps/SectorDamage.java | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/core/src/mindustry/entities/bullet/BulletType.java b/core/src/mindustry/entities/bullet/BulletType.java index 4d93321367..ddcab2e9d5 100644 --- a/core/src/mindustry/entities/bullet/BulletType.java +++ b/core/src/mindustry/entities/bullet/BulletType.java @@ -347,7 +347,7 @@ public abstract class BulletType extends Content{ bullet.damage = (damage < 0 ? this.damage : damage) * bullet.damageMultiplier(); bullet.add(); - if(keepVelocity && owner instanceof Velc) bullet.vel.add(((Velc)owner).vel().x, ((Velc)owner).vel().y); + if(keepVelocity && owner instanceof Velc v) bullet.vel.add(v.vel().x, v.vel().y); return bullet; } @@ -357,6 +357,7 @@ public abstract class BulletType extends Content{ @Remote(called = Loc.server, unreliable = true) public static void createBullet(BulletType type, Team team, float x, float y, float angle, float damage, float velocityScl, float lifetimeScl){ + if(type == null) return; type.create(null, team, x, y, angle, damage, velocityScl, lifetimeScl, null); } } diff --git a/core/src/mindustry/io/TypeIO.java b/core/src/mindustry/io/TypeIO.java index 9449a89b64..58446a8018 100644 --- a/core/src/mindustry/io/TypeIO.java +++ b/core/src/mindustry/io/TypeIO.java @@ -296,7 +296,7 @@ public class TypeIO{ if(control instanceof Player p){ write.b(0); write.i(p.id); - }else if(control instanceof FormationAI form){ + }else if(control instanceof FormationAI form && form.leader != null){ write.b(1); write.i(form.leader.id); }else if(control instanceof LogicAI logic && logic.controller != null){ diff --git a/core/src/mindustry/maps/SectorDamage.java b/core/src/mindustry/maps/SectorDamage.java index e2da570bf8..1ebd0a4d16 100644 --- a/core/src/mindustry/maps/SectorDamage.java +++ b/core/src/mindustry/maps/SectorDamage.java @@ -340,7 +340,7 @@ public class SectorDamage{ } if(bossGroup != null){ - float bossMult = 1.1f; + float bossMult = 1.2f; //calculate first boss appearaance for(int wave = state.wave; wave < state.wave + 60; wave++){ int spawned = bossGroup.getSpawned(wave - 1);