Merge branch 'template_train_replacement-sx' into jgrpp

Remove a duplicated declaration.

# Conflicts:
#	projects/openttd_vs100.vcxproj
#	projects/openttd_vs100.vcxproj.filters
#	projects/openttd_vs140.vcxproj
#	projects/openttd_vs140.vcxproj.filters
#	projects/openttd_vs80.vcproj
#	projects/openttd_vs90.vcproj
#	source.list
#	src/group_gui.cpp
#	src/lang/english.txt
#	src/network/network_command.cpp
#	src/saveload/extended_ver_sl.cpp
#	src/saveload/extended_ver_sl.h
#	src/saveload/saveload.cpp
#	src/train_cmd.cpp
#	src/vehicle.cpp
#	src/vehicle_gui.cpp
#	src/vehicle_gui_base.h
#	src/window_type.h
This commit is contained in:
Jonathan G Rennison
2016-02-14 17:55:51 +00:00
54 changed files with 4946 additions and 72 deletions

View File

@@ -137,6 +137,7 @@ struct Train FINAL : public GroundVehicle<Train, VEH_TRAIN> {
bool Tick();
void OnNewDay();
uint Crash(bool flooded = false);
Money CalculateCurrentOverallValue() const;
Trackdir GetVehicleTrackdir() const;
TileIndex GetOrderStationLocation(StationID station);
bool FindClosestDepot(TileIndex *location, DestinationID *destination, bool *reverse);
@@ -177,6 +178,17 @@ struct Train FINAL : public GroundVehicle<Train, VEH_TRAIN> {
return v;
}
/* Get the last vehicle of a chain
* @return pointer the last vehicle in a chain
*/
inline Train *GetLastUnit() {
Train *tmp = this;
while (tmp->GetNextUnit()) {
tmp = tmp->GetNextUnit();
}
return tmp;
}
/**
* Calculate the offset from this vehicle's center to the following center taking the vehicle lengths into account.
* @return Offset from center to center.
@@ -368,6 +380,13 @@ protected: // These functions should not be called outside acceleration code.
}
};
CommandCost CmdMoveRailVehicle(TileIndex, DoCommandFlag , uint32, uint32, const char *);
CommandCost CmdMoveVirtualRailVehicle(TileIndex, DoCommandFlag, uint32, uint32, const char*);
Train* CmdBuildVirtualRailWagon(const Engine*);
Train* CmdBuildVirtualRailVehicle(EngineID);
#define FOR_ALL_TRAINS(var) FOR_ALL_VEHICLES_OF_TYPE(Train, var)
#endif /* TRAIN_H */