From 7c56f59aedddb6bb18d85e778a3acbef16b4c54f Mon Sep 17 00:00:00 2001 From: Paweł Redman Date: Sat, 21 Apr 2018 14:18:28 +0200 Subject: Deselect all types of units when they die. --- src/game/unit_soldier.cpp | 1 - src/game/units.cpp | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/game/unit_soldier.cpp b/src/game/unit_soldier.cpp index 7985df6..0ffe19f 100644 --- a/src/game/unit_soldier.cpp +++ b/src/game/unit_soldier.cpp @@ -228,7 +228,6 @@ void unit_soldier_t::on_death(void) cmodel.cflags = CF_BACKGROUND; place(world, x); controllable = false; - game->selected_units.erase(this); move_marker.reset(); aim_marker.reset(); } diff --git a/src/game/units.cpp b/src/game/units.cpp index 735ed89..f1ee45e 100644 --- a/src/game/units.cpp +++ b/src/game/units.cpp @@ -237,6 +237,8 @@ void unit_t::die(unit_t *killer) sleep(); ignore_waking = true; + game->selected_units.erase(this); + on_death(); } -- cgit