Moved the disabling of the alive-flag on entities.

This commit is contained in:
Jeasonfire 2015-05-18 04:00:16 +03:00
parent 63f50a199a
commit 5ccb90911d
2 changed files with 2 additions and 2 deletions

View File

@ -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),

View File

@ -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);
}