Formatting

This commit is contained in:
2018-02-17 18:14:38 -05:00
parent b7d62067cc
commit 1d5e0c2e1e
3 changed files with 13 additions and 19 deletions

View File

@@ -1257,11 +1257,10 @@ void erase_out_specials() {
}
}
void erase_hidden_towns(cOutdoors& sector, int quadrant_x, int quadrant_y)
{
for (short tile_index = 0; tile_index < sector.city_locs.size(); tile_index++) {
void erase_hidden_towns(cOutdoors& sector, int quadrant_x, int quadrant_y) {
for(short tile_index = 0; tile_index < sector.city_locs.size(); tile_index++) {
auto city_loc = sector.city_locs[tile_index];
if (!univ.scenario.is_town_entrance_valid(city_loc) ||
if(!univ.scenario.is_town_entrance_valid(city_loc) ||
!does_location_have_special(sector, city_loc, eTerSpec::TOWN_ENTRANCE) ||
!sector.is_on_map(city_loc)) {
continue;
@@ -1271,7 +1270,7 @@ void erase_hidden_towns(cOutdoors& sector, int quadrant_x, int quadrant_y)
auto spec_pos_x = sector.city_locs[tile_index].x;
auto spec_pos_y = sector.city_locs[tile_index].y;
auto area_index = sector.terrain[spec_pos_x][spec_pos_y];
if (!univ.scenario.towns[sector.city_locs[tile_index].spec]->can_find) {
if(!univ.scenario.towns[sector.city_locs[tile_index].spec]->can_find) {
univ.out[town_pos_x][town_pos_y] = univ.scenario.ter_types[area_index].flag1;
} else {
univ.out[town_pos_x][town_pos_y] = area_index;
@@ -1279,17 +1278,16 @@ void erase_hidden_towns(cOutdoors& sector, int quadrant_x, int quadrant_y)
}
}
void erase_completed_specials(cOutdoors& sector)
{
for (auto tile_index = 0; tile_index < sector.special_locs.size(); tile_index++) {
if (sector.special_locs[tile_index].spec < 0 ||
void erase_completed_specials(cOutdoors& sector) {
for(auto tile_index = 0; tile_index < sector.special_locs.size(); tile_index++) {
if(sector.special_locs[tile_index].spec < 0 ||
sector.special_locs[tile_index].spec >= sector.specials.size())
continue;
auto sn = sector.specials[sector.special_locs[tile_index].spec];
if (univ.party.sd_legit(sn.sd1, sn.sd2) && PSD[sn.sd1][sn.sd2] == SDF_COMPLETE) {
if(univ.party.sd_legit(sn.sd1, sn.sd2) && PSD[sn.sd1][sn.sd2] == SDF_COMPLETE) {
auto completed_special = sector.special_locs[tile_index];
if (!sector.is_on_map(completed_special)) {
if(!sector.is_on_map(completed_special)) {
beep();
add_string_to_buf("Outdoor section corrupt. Problem fixed.");
sector.special_locs[tile_index].spec = -1; // TODO: Again, was there a reason for commenting this out?
@@ -1300,8 +1298,7 @@ void erase_completed_specials(cOutdoors& sector)
}
}
bool does_location_have_special(cOutdoors& sector, location loc, eTerSpec special)
{
bool does_location_have_special(cOutdoors& sector, location loc, eTerSpec special) {
auto terrain_index = sector.terrain[loc.x][loc.y];
return univ.scenario.ter_types[terrain_index].special == special;
}