Merge branch 'master' into jgrpp
# Conflicts: # config.lib # projects/openttd_vs140.vcxproj # projects/openttd_vs140.vcxproj.filters # projects/openttd_vs141.vcxproj # projects/openttd_vs141.vcxproj.filters # projects/openttd_vs142.vcxproj # projects/openttd_vs142.vcxproj.filters # src/aircraft_cmd.cpp # src/base_station_base.h # src/core/pool_type.hpp # src/disaster_vehicle.cpp # src/economy.cpp # src/engine.cpp # src/group.h # src/group_cmd.cpp # src/group_gui.cpp # src/lang/english.txt # src/lang/german.txt # src/linkgraph/linkgraph_gui.cpp # src/network/network_command.cpp # src/network/network_server.cpp # src/openttd.cpp # src/order_cmd.cpp # src/road_cmd.cpp # src/saveload/afterload.cpp # src/saveload/cargopacket_sl.cpp # src/saveload/linkgraph_sl.cpp # src/saveload/order_sl.cpp # src/saveload/station_sl.cpp # src/saveload/town_sl.cpp # src/saveload/vehicle_sl.cpp # src/screenshot.cpp # src/screenshot.h # src/settings_gui.cpp # src/settings_type.h # src/smallmap_gui.cpp # src/station.cpp # src/station_cmd.cpp # src/table/settings.ini # src/toolbar_gui.cpp # src/town_cmd.cpp # src/train.h # src/train_cmd.cpp # src/train_gui.cpp # src/vehicle.cpp # src/vehicle_base.h # src/vehiclelist.cpp # src/window_type.h
This commit is contained in:
@@ -47,8 +47,7 @@ Vehicle *vhead, *vtmp;
|
||||
// debugging printing functions for convenience, usually called from gdb
|
||||
void tbtr_debug_pat()
|
||||
{
|
||||
TemplateVehicle *tv;
|
||||
FOR_ALL_TEMPLATES(tv) {
|
||||
for (TemplateVehicle *tv : TemplateVehicle::Iterate()) {
|
||||
if (tv->Prev()) continue;
|
||||
tbtr_debug_ptv(tv);
|
||||
printf("__________\n");
|
||||
@@ -57,8 +56,7 @@ void tbtr_debug_pat()
|
||||
|
||||
void tbtr_debug_pav()
|
||||
{
|
||||
Train *t;
|
||||
FOR_ALL_TRAINS(t) {
|
||||
for (Train *t : Train::Iterate()) {
|
||||
if (t->Previous()) continue;
|
||||
tbtr_debug_pvt(t);
|
||||
printf("__________\n");
|
||||
@@ -90,9 +88,7 @@ void tbtr_debug_pvt (const Train *printme)
|
||||
void BuildTemplateGuiList(GUITemplateList *list, Scrollbar *vscroll, Owner oid, RailType railtype)
|
||||
{
|
||||
list->clear();
|
||||
const TemplateVehicle *tv;
|
||||
|
||||
FOR_ALL_TEMPLATES(tv) {
|
||||
for (const TemplateVehicle *tv : TemplateVehicle::Iterate()) {
|
||||
if (tv->owner == oid && (tv->IsPrimaryVehicle() || tv->IsFreeWagonChain()) && TemplateVehicleContainsEngineOfRailtype(tv, railtype)) {
|
||||
list->push_back(tv);
|
||||
}
|
||||
@@ -208,8 +204,7 @@ Train* DeleteVirtualTrain(Train *chain, Train *to_del) {
|
||||
// retrieve template vehicle from template replacement that belongs to the given group
|
||||
TemplateVehicle* GetTemplateVehicleByGroupID(GroupID gid) {
|
||||
if (gid >= NEW_GROUP) return nullptr;
|
||||
TemplateReplacement *tr;
|
||||
FOR_ALL_TEMPLATE_REPLACEMENTS(tr) {
|
||||
for (TemplateReplacement *tr : TemplateReplacement::Iterate()) {
|
||||
if (tr->Group() == gid) {
|
||||
return TemplateVehicle::GetIfValid(tr->Template()); // there can be only one
|
||||
}
|
||||
@@ -266,8 +261,7 @@ Train* ChainContainsEngine(EngineID eid, Train *chain) {
|
||||
// has O(n^2)
|
||||
Train* DepotContainsEngine(TileIndex tile, EngineID eid, Train *not_in = nullptr)
|
||||
{
|
||||
Train *t;
|
||||
FOR_ALL_TRAINS(t) {
|
||||
for (Train *t : Train::Iterate()) {
|
||||
// conditions: v is stopped in the given depot, has the right engine and if 'not_in' is given v must not be contained within 'not_in'
|
||||
// if 'not_in' is nullptr, no check is needed
|
||||
if (t->tile == tile
|
||||
@@ -348,8 +342,7 @@ int NumTrainsNeedTemplateReplacement(GroupID g_id, const TemplateVehicle *tv)
|
||||
int count = 0;
|
||||
if (!tv) return count;
|
||||
|
||||
const Train *t;
|
||||
FOR_ALL_TRAINS(t) {
|
||||
for (Train *t : Train::Iterate()) {
|
||||
if (t->IsPrimaryVehicle() && t->group_id == g_id && (!TrainMatchesTemplate(t, tv) || !TrainMatchesTemplateRefit(t, tv))) {
|
||||
count++;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user