From c7443ac81309180323cac21af081a741371e5d75 Mon Sep 17 00:00:00 2001 From: Charles Dang Date: Thu, 20 Jul 2017 14:02:21 +1100 Subject: [PATCH] Display: fixed moving units drawing under foreground terrains --- src/display.cpp | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/display.cpp b/src/display.cpp index ffda8943a378..25fcb6f1c3ec 100644 --- a/src/display.cpp +++ b/src/display.cpp @@ -2496,21 +2496,15 @@ void display::draw_gamemap() } // - // Units + // Real (standing) units // if(!dc_->teams().empty()) { unit_drawer drawer = unit_drawer(*this); - // Real units for(const unit& real_unit : dc_->units()) { drawer.redraw_unit(real_unit); } - // Fake (moving) units - for(const unit* temp_unit : *fake_unit_man_) { - drawer.redraw_unit(*temp_unit); - } - // TODO: re-add exclusionary checks for exclusive_unit_draw_requests_ later on, if necessary. #if 0 auto request = exclusive_unit_draw_requests_.find(loc); @@ -2523,6 +2517,17 @@ void display::draw_gamemap() // draw_visible_hexes(visible_hexes, FOREGROUND); + // + // Fake (moving) units + // + if(!dc_->teams().empty()) { + unit_drawer drawer = unit_drawer(*this); // TODO: don't create this twice per cycle. + + for(const unit* temp_unit : *fake_unit_man_) { + drawer.redraw_unit(*temp_unit); + } + } + // // Draws various overlays, such as reach maps, etc. //