yes that var is useless. The block could be replaced by
// iterate through all buildings to find first predecessor
const Tribe_Descr & t = b.descr().tribe();
while (true) {
const Building_Descr * oldest = b.m_old_buildings.front();
if (!oldest->is_enhanced()) {
break;
}
const Building_Index & oldest_idx = t.building_index(oldest->name());
for (Building_Index i = Building_Index::First(); i < t.get_nrbuildings(); ++i) {
Building_Descr const * ob = t.get_building_descr(i);
if (ob->enhancements().count(oldest_idx)) {
b.m_old_buildings.insert(b.m_old_buildings.begin(), ob);
break;
}
}
}
}
yes that var is useless. The block could be replaced by buildings. front() ; >is_enhanced( )) { index(oldest- >name() ); Index:: First() ; i < t.get_nrbuildin gs(); ++i) { descr(i) ; ts().count( oldest_ idx)) { old_buildings. insert( b.m_old_ buildings. begin() , ob);
// iterate through all buildings to find first predecessor
const Tribe_Descr & t = b.descr().tribe();
while (true) {
const Building_Descr * oldest = b.m_old_
if (!oldest-
break;
}
const Building_Index & oldest_idx = t.building_
for (Building_Index i = Building_
Building_Descr const * ob = t.get_building_
if (ob->enhancemen
b.m_
break;
}
}
}
}