Skip to content

Commit

Permalink
no movement orbs for enemy statues
Browse files Browse the repository at this point in the history
Putting a movement orb on an enemy petrified unit is rather
redundant, so this commit prevents that behavior. Statues owned
by the viewing team will still have orbs, which seems acceptable.
  • Loading branch information
cbeck88 committed Jun 3, 2014
1 parent baa53ef commit 089ba15
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions src/unit.cpp
Expand Up @@ -2062,7 +2062,11 @@ void unit::redraw_unit()
if(size_t(side()) != disp.viewing_team()+1) {
if(disp.team_valid() &&
disp.get_teams()[disp.viewing_team()].is_enemy(side())) {
orb_img = &enemy_orb;
if (!get_state(STATE_PETRIFIED)) {
orb_img = &enemy_orb;
} else {
orb_img = NULL;
}
} else {
orb_img = &ally_orb;
}
Expand All @@ -2077,11 +2081,12 @@ void unit::redraw_unit()
}
}

assert(orb_img != NULL);
surface orb(image::get_image(*orb_img,image::SCALED_TO_ZOOM));
if (orb != NULL) {
disp.drawing_buffer_add(display::LAYER_UNIT_BAR,
loc_, xsrc, ysrc +adjusted_params.y, orb);
if (orb_img != NULL) {
surface orb(image::get_image(*orb_img,image::SCALED_TO_ZOOM));
if (orb != NULL) {
disp.drawing_buffer_add(display::LAYER_UNIT_BAR,
loc_, xsrc, ysrc +adjusted_params.y, orb);
}
}

double unit_energy = 0.0;
Expand Down

0 comments on commit 089ba15

Please sign in to comment.