Change town locations variable name to better reflect its use

This commit is contained in:
2015-02-06 14:55:37 -05:00
parent 7f6992da56
commit 7307fee425
6 changed files with 35 additions and 35 deletions

View File

@@ -2027,25 +2027,25 @@ void town_entry(location spot_hit) {
return;
}
// clean up old town entries
for(x = 0; x < current_terrain->exit_locs.size(); x++)
if(current_terrain->exit_locs[x].spec >= 0) {
ter = current_terrain->terrain[current_terrain->exit_locs[x].x][current_terrain->exit_locs[x].y];
for(x = 0; x < current_terrain->city_locs.size(); x++)
if(current_terrain->city_locs[x].spec >= 0) {
ter = current_terrain->terrain[current_terrain->city_locs[x].x][current_terrain->city_locs[x].y];
if(scenario.ter_types[ter].special != eTerSpec::TOWN_ENTRANCE)
current_terrain->exit_locs[x].spec = -1;
current_terrain->city_locs[x].spec = -1;
}
y = -2;
for(x = 0; x < current_terrain->exit_locs.size(); x++)
if(current_terrain->exit_locs[x] == spot_hit) {
y = pick_town_num("select-town-enter",current_terrain->exit_locs[x].spec,scenario);
if(y >= 0) current_terrain->exit_locs[x].spec = y;
for(x = 0; x < current_terrain->city_locs.size(); x++)
if(current_terrain->city_locs[x] == spot_hit) {
y = pick_town_num("select-town-enter",current_terrain->city_locs[x].spec,scenario);
if(y >= 0) current_terrain->city_locs[x].spec = y;
}
if(y == -2) {
for(x = 0; x < current_terrain->exit_locs.size(); x++)
if(current_terrain->exit_locs[x].spec < 0) {
for(x = 0; x < current_terrain->city_locs.size(); x++)
if(current_terrain->city_locs[x].spec < 0) {
y = pick_town_num("select-town-enter",0,scenario);
if(y >= 0) {
current_terrain->exit_locs[x].spec = y;
current_terrain->exit_locs[x] = spot_hit;
current_terrain->city_locs[x].spec = y;
current_terrain->city_locs[x] = spot_hit;
}
x = 500;
}

View File

@@ -797,9 +797,9 @@ static map_data buildOutMapData(location which) {
if(sector.special_locs[i].spec >= 0)
terrain.addFeature(sector.special_locs[i].x, sector.special_locs[i].y, eMapFeature::SPECIAL_NODE, sector.special_locs[i].spec);
}
for(size_t i = 0; i < sector.exit_locs.size(); i++) {
if(sector.exit_locs[i].spec >= 0)
terrain.addFeature(sector.exit_locs[i].x, sector.exit_locs[i].y, eMapFeature::TOWN, sector.exit_locs[i].spec);
for(size_t i = 0; i < sector.city_locs.size(); i++) {
if(sector.city_locs[i].spec >= 0)
terrain.addFeature(sector.city_locs[i].x, sector.city_locs[i].y, eMapFeature::TOWN, sector.city_locs[i].spec);
}
for(size_t i = 0; i < sector.sign_locs.size(); i++) {
if(!sector.sign_locs[i].text.empty())