summaryrefslogtreecommitdiff
path: root/src/game
diff options
context:
space:
mode:
authorPaweł Redman <pawel.redman@gmail.com>2018-04-21 14:18:28 +0200
committerPaweł Redman <pawel.redman@gmail.com>2018-04-21 14:18:28 +0200
commit7c56f59aedddb6bb18d85e778a3acbef16b4c54f (patch)
tree5994012f810d59c8e9e80818f53469539e09ac8e /src/game
parent7798f9ada1a4248e178734bc5adfd3b609bdb9a6 (diff)
Deselect all types of units when they die.
Diffstat (limited to 'src/game')
-rw-r--r--src/game/unit_soldier.cpp1
-rw-r--r--src/game/units.cpp2
2 files changed, 2 insertions, 1 deletions
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();
}