Skip to content

Commit

Permalink
Merge pull request #187 from cbeck88/fixup_statue_orbs_1.12
Browse files Browse the repository at this point in the history
Fixup statue orbs 1.12
  • Loading branch information
AI0867 committed Jun 3, 2014
2 parents baa53ef + 089ba15 commit 01fe3f5
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 01fe3f5

Please sign in to comment.