Merge branch 'master' into jgrpp
# Conflicts: # cmake/CompileFlags.cmake # src/cargomonitor.cpp # src/core/CMakeLists.txt # src/economy.cpp # src/landscape.cpp # src/linkgraph/flowmapper.cpp # src/linkgraph/linkgraph_gui.cpp # src/linkgraph/linkgraphschedule.cpp # src/misc_gui.cpp # src/newgrf_generic.cpp # src/newgrf_storage.cpp # src/rail_gui.cpp # src/saveload/afterload.cpp # src/saveload/station_sl.cpp # src/script/script_gui.cpp # src/station_cmd.cpp # src/station_gui.cpp # src/string_func.h # src/terraform_cmd.cpp
This commit is contained in:
@@ -1184,9 +1184,9 @@ CargoDataEntry::~CargoDataEntry()
|
||||
void CargoDataEntry::Clear()
|
||||
{
|
||||
if (this->children != nullptr) {
|
||||
for (CargoDataSet::iterator i = this->children->begin(); i != this->children->end(); ++i) {
|
||||
assert(*i != this);
|
||||
delete *i;
|
||||
for (auto &it : *this->children) {
|
||||
assert(it != this);
|
||||
delete it;
|
||||
}
|
||||
this->children->clear();
|
||||
}
|
||||
@@ -1650,19 +1650,19 @@ struct StationViewWindow : public Window {
|
||||
cargo_entry->Clear();
|
||||
|
||||
const FlowStatMap &flows = st->goods[i].flows;
|
||||
for (FlowStatMap::const_iterator it = flows.begin(); it != flows.end(); ++it) {
|
||||
StationID from = it->GetOrigin();
|
||||
for (const auto &it : flows) {
|
||||
StationID from = it.GetOrigin();
|
||||
CargoDataEntry *source_entry = cargo_entry->InsertOrRetrieve(from);
|
||||
uint32 prev_count = 0;
|
||||
for (FlowStat::const_iterator flow_it = it->begin(); flow_it != it->end(); ++flow_it) {
|
||||
StationID via = flow_it->second;
|
||||
for (const auto &flow_it : it) {
|
||||
StationID via = flow_it.second;
|
||||
CargoDataEntry *via_entry = source_entry->InsertOrRetrieve(via);
|
||||
if (via == this->window_number) {
|
||||
via_entry->InsertOrRetrieve(via)->Update(flow_it->first - prev_count);
|
||||
via_entry->InsertOrRetrieve(via)->Update(flow_it.first - prev_count);
|
||||
} else {
|
||||
EstimateDestinations(i, from, via, flow_it->first - prev_count, via_entry);
|
||||
EstimateDestinations(i, from, via, flow_it.first - prev_count, via_entry);
|
||||
}
|
||||
prev_count = flow_it->first;
|
||||
prev_count = flow_it.first;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user