From 031af7c43204ae1b56e34fb19303165f5f1d4ff5 Mon Sep 17 00:00:00 2001 From: Anuken Date: Sat, 18 Jun 2022 16:07:04 -0400 Subject: [PATCH] UnitType death handling --- core/src/mindustry/entities/comp/UnitComp.java | 2 ++ core/src/mindustry/type/UnitType.java | 2 ++ core/src/mindustry/world/blocks/production/GenericCrafter.java | 1 - 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/core/src/mindustry/entities/comp/UnitComp.java b/core/src/mindustry/entities/comp/UnitComp.java index 062cc810d6..e351af910b 100644 --- a/core/src/mindustry/entities/comp/UnitComp.java +++ b/core/src/mindustry/entities/comp/UnitComp.java @@ -609,6 +609,8 @@ abstract class UnitComp implements Healthc, Physicsc, Hitboxc, Statusc, Teamc, I a.death(self()); } + type.killed(self()); + remove(); } diff --git a/core/src/mindustry/type/UnitType.java b/core/src/mindustry/type/UnitType.java index bfae830600..881d359176 100644 --- a/core/src/mindustry/type/UnitType.java +++ b/core/src/mindustry/type/UnitType.java @@ -470,6 +470,8 @@ public class UnitType extends UnlockableContent{ } + public void killed(Unit unit){} + public void landed(Unit unit){} public void display(Unit unit, Table table){ diff --git a/core/src/mindustry/world/blocks/production/GenericCrafter.java b/core/src/mindustry/world/blocks/production/GenericCrafter.java index d5f5a870e8..4a9b65f9b8 100644 --- a/core/src/mindustry/world/blocks/production/GenericCrafter.java +++ b/core/src/mindustry/world/blocks/production/GenericCrafter.java @@ -35,7 +35,6 @@ public class GenericCrafter extends Block{ public boolean dumpExtraLiquid = true; public boolean ignoreLiquidFullness = false; - //TODO should be seconds? public float craftTime = 80; public Effect craftEffect = Fx.none; public Effect updateEffect = Fx.none;