Moved the disabling of the alive-flag on entities.
This commit is contained in:
parent
63f50a199a
commit
5ccb90911d
@ -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),
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user