Stop shooting upon crawler death

This commit is contained in:
Anuken
2021-01-29 12:02:31 -05:00
parent d512aa5b21
commit 9142da2b70
3 changed files with 13 additions and 9 deletions

View File

@@ -68,6 +68,14 @@ public abstract class InputHandler implements InputProcessor, GestureListener{
public Seq<BuildPlan> lineRequests = new Seq<>();
public Seq<BuildPlan> selectRequests = new Seq<>();
public InputHandler(){
Events.on(UnitDestroyEvent.class, e -> {
if(e.unit != null && e.unit.isPlayer() && e.unit.getPlayer().isLocal() && e.unit.type.weapons.contains(w -> w.bullet.killShooter)){
player.shooting = false;
}
});
}
//methods to override
@Remote(called = Loc.server, unreliable = true)