From 5ccb90911d74d7b92c8b045f0c8156c25b799f50 Mon Sep 17 00:00:00 2001 From: Jeasonfire Date: Mon, 18 May 2015 04:00:16 +0300 Subject: [PATCH] Moved the disabling of the alive-flag on entities. --- .../com/saltosion/gladiator/listeners/BasicDeathListener.java | 2 -- core/src/com/saltosion/gladiator/systems/CombatSystem.java | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/com/saltosion/gladiator/listeners/BasicDeathListener.java b/core/src/com/saltosion/gladiator/listeners/BasicDeathListener.java index 528c594..c30e87a 100644 --- a/core/src/com/saltosion/gladiator/listeners/BasicDeathListener.java +++ b/core/src/com/saltosion/gladiator/listeners/BasicDeathListener.java @@ -32,8 +32,6 @@ public class BasicDeathListener implements CombatListener { @Override public void died(Entity source, Entity target, int damageTaken) { - target.flags &= ~Global.FLAG_ALIVE; - CPhysics cp = target.getComponent(CPhysics.class); Sound s = AppUtil.jukebox.returnRandomSound(AudioLoader.getSound(Name.SOUND_HIT01), diff --git a/core/src/com/saltosion/gladiator/systems/CombatSystem.java b/core/src/com/saltosion/gladiator/systems/CombatSystem.java index 5c5de3d..d0244e2 100644 --- a/core/src/com/saltosion/gladiator/systems/CombatSystem.java +++ b/core/src/com/saltosion/gladiator/systems/CombatSystem.java @@ -33,6 +33,7 @@ import com.saltosion.gladiator.listeners.SwingHitboxListener; import com.saltosion.gladiator.util.AppUtil; import com.saltosion.gladiator.util.AudioLoader; import com.saltosion.gladiator.util.Direction; +import com.saltosion.gladiator.util.Global; import com.saltosion.gladiator.util.Name; public class CombatSystem extends EntitySystem { @@ -145,6 +146,7 @@ public class CombatSystem extends EntitySystem { public static void killEntity(Entity source, Entity target, int damage) { CCombat combat = target.getComponent(CCombat.class); CombatListener listener = combat.getCombatListener(); + target.flags &= ~Global.FLAG_ALIVE; if (listener != null) { listener.died(source, target, damage); }