diff options
Diffstat (limited to 'src/game/units.cpp')
-rw-r--r-- | src/game/units.cpp | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/src/game/units.cpp b/src/game/units.cpp index d1648d7..201b7be 100644 --- a/src/game/units.cpp +++ b/src/game/units.cpp @@ -58,6 +58,17 @@ void unit_t::render_to(render::state_t *render) if (move.moving && debug_draw_paths) render->debug_path(&move.path); + + if (say_time + 5.0 > game->now) { + v2f_t text_pos; + float height; + + text_pos = render_bounds[0] + v2f_t(render_bounds.dim(0) / 2, -render_bounds.dim(1) * 0.1); + height = size.dim_min() * 0.20f; + render->render_text(text_pos, height, say_text, + render::ALIGN_CENTER_BOTTOM, + sf::Color::White); + } } void unit_t::say(std::string str) @@ -304,6 +315,7 @@ void human_t::die(void) render_size[0] = v2f_t(-0.75f, -0.5f); render_size[1] = v2f_t(+0.75f, +0.5f); render_layer = -1; + cmodel.cflags = CF_BACKGROUND; unlink(); compute_bounds(); link(world); @@ -339,17 +351,6 @@ void human_t::render_to(render::state_t *render) } else render->render(&assets::human.dead, render_bounds); - if (say_time + 5.0 > game->now) { - v2f_t text_pos; - float height; - - text_pos = render_bounds[0] + v2f_t(render_bounds.dim(0) / 2, -render_bounds.dim(1) * 0.1); - height = size.dim_min() * 0.20f; - render->render_text(text_pos, height, say_text, - render::ALIGN_CENTER_BOTTOM, - sf::Color::White); - } - unit_t::render_to(render); } @@ -381,6 +382,7 @@ void alien_t::sleep(void) void alien_t::die(void) { render_layer = -1; + cmodel.cflags = CF_BACKGROUND; } void alien_t::think(void) |