Skip to content

Commit

Permalink
Display: fixed moving units drawing under foreground terrains
Browse files Browse the repository at this point in the history
  • Loading branch information
Vultraz committed Jul 31, 2017
1 parent 8efba12 commit c7443ac
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions src/display.cpp
Expand Up @@ -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);
Expand All @@ -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.
//
Expand Down

0 comments on commit c7443ac

Please sign in to comment.