Minor readability cleanup.

This commit is contained in:
Mark de Wever 2011-02-19 12:25:09 +00:00
parent ff422edc9c
commit 5606ca0319

View file

@ -345,11 +345,17 @@ REPORT_GENERATOR(unit_advancement_options)
REPORT_GENERATOR(unit_defense)
{
unit *u = get_visible_unit();
if (!u) return report();
if(!u) {
return report();
}
std::ostringstream str, tooltip;
const gamemap &map = *resources::game_map;
const map_location& displayed_unit_hex = resources::screen->displayed_unit_hex();
if (!resources::game_map->on_board(displayed_unit_hex)) return report();
if(!resources::game_map->on_board(displayed_unit_hex)) {
return report();
}
const t_translation::t_terrain &terrain = map[displayed_unit_hex];
int def = 100 - u->defense_modifier(terrain);
SDL_Color color = int_to_color(game_config::red_to_green(def));