Merge branch 'master' into jgrpp

# Conflicts:
#	src/aircraft_cmd.cpp
#	src/autoreplace_cmd.cpp
#	src/pathfinder/follow_track.hpp
#	src/pathfinder/yapf/yapf_rail.cpp
#	src/saveload/afterload.cpp
#	src/saveload/saveload.cpp
#	src/script/api/ai/ai_station.hpp.sq
#	src/script/api/game/game_station.hpp.sq
#	src/script/api/script_station.hpp
#	src/track_func.h
#	src/vehicle_base.h
This commit is contained in:
Jonathan G Rennison
2018-11-05 12:53:36 +00:00
208 changed files with 1329 additions and 686 deletions

View File

@@ -781,7 +781,7 @@ void GetTrainSpriteSize(EngineID engine, uint &width, uint &height, int &xoffs,
* @param tile tile of the depot where rail-vehicle is built.
* @param flags type of operation.
* @param e the engine to build.
* @param ret[out] the vehicle that has been built.
* @param[out] ret the vehicle that has been built.
* @return the cost of this operation or an error.
*/
static CommandCost CmdBuildRailWagon(TileIndex tile, DoCommandFlag flags, const Engine *e, Vehicle **ret)
@@ -918,7 +918,7 @@ static void AddRearEngineToMultiheadedTrain(Train *v)
* @param flags type of operation.
* @param e the engine to build.
* @param data bit 0 prevents any free cars from being added to the train.
* @param ret[out] the vehicle that has been built.
* @param[out] ret the vehicle that has been built.
* @return the cost of this operation or an error.
*/
CommandCost CmdBuildRailVehicle(TileIndex tile, DoCommandFlag flags, const Engine *e, uint16 data, Vehicle **ret)
@@ -1082,7 +1082,7 @@ static void RemoveFromConsist(Train *part, bool chain = false)
static void InsertInConsist(Train *dst, Train *chain)
{
/* We do not want to add something in the middle of an articulated part. */
assert(dst->Next() == NULL || !dst->Next()->IsArticulatedPart());
assert(dst != NULL && (dst->Next() == NULL || !dst->Next()->IsArticulatedPart()));
chain->Last()->SetNext(dst->Next());
dst->SetNext(chain);
@@ -1143,8 +1143,8 @@ static void NormaliseSubtypes(Train *chain)
* @note All vehicles are/were 'heads' of their chains.
* @param original_dst The original destination chain.
* @param dst The destination chain after constructing the train.
* @param original_dst The original source chain.
* @param dst The source chain after constructing the train.
* @param original_src The original source chain.
* @param src The source chain after constructing the train.
* @return possible error of this command.
*/
static CommandCost CheckNewTrain(Train *original_dst, Train *dst, Train *original_src, Train *src)
@@ -1262,8 +1262,8 @@ static CommandCost CheckTrainAttachment(Train *t)
* @note All vehicles are/were 'heads' of their chains.
* @param original_dst The original destination chain.
* @param dst The destination chain after constructing the train.
* @param original_dst The original source chain.
* @param dst The source chain after constructing the train.
* @param original_src The original source chain.
* @param src The source chain after constructing the train.
* @param check_limit Whether to check the vehicle limit.
* @return possible error of this command.
*/
@@ -1754,8 +1754,8 @@ static void MarkTrainAsStuck(Train *v, bool waiting_restriction = false)
* Swap the two up/down flags in two ways:
* - Swap values of \a swap_flag1 and \a swap_flag2, and
* - If going up previously (#GVF_GOINGUP_BIT set), the #GVF_GOINGDOWN_BIT is set, and vice versa.
* @param swap_flag1 [inout] First train flag.
* @param swap_flag2 [inout] Second train flag.
* @param[in,out] swap_flag1 First train flag.
* @param[in,out] swap_flag2 Second train flag.
*/
static void SwapTrainFlags(uint16 *swap_flag1, uint16 *swap_flag2)
{
@@ -2367,9 +2367,9 @@ static FindDepotData FindClosestTrainDepot(Train *v, int max_distance)
/**
* Locate the closest depot for this consist, and return the information to the caller.
* @param location [out] If not \c NULL and a depot is found, store its location in the given address.
* @param destination [out] If not \c NULL and a depot is found, store its index in the given address.
* @param reverse [out] If not \c NULL and a depot is found, store reversal information in the given address.
* @param[out] location If not \c NULL and a depot is found, store its location in the given address.
* @param[out] destination If not \c NULL and a depot is found, store its index in the given address.
* @param[out] reverse If not \c NULL and a depot is found, store reversal information in the given address.
* @return A depot has been found.
*/
bool Train::FindClosestDepot(TileIndex *location, DestinationID *destination, bool *reverse)
@@ -2750,9 +2750,9 @@ static const byte _initial_tile_subcoord[6][4][3] = {
* @param tile The tile the train is about to enter
* @param enterdir Diagonal direction the train is coming from
* @param tracks Usable tracks on the new tile
* @param path_found [out] Whether a path has been found or not.
* @param[out] path_found Whether a path has been found or not.
* @param do_track_reservation Path reservation is requested
* @param dest [out] State and destination of the requested path
* @param[out] dest State and destination of the requested path
* @return The best track the train should follow
*/
static Track DoTrainPathfind(const Train *v, TileIndex tile, DiagDirection enterdir, TrackBits tracks, bool &path_found, bool do_track_reservation, PBSTileInfo *dest)
@@ -2874,11 +2874,11 @@ static PBSTileInfo ExtendTrainReservation(const Train *v, const PBSTileInfo &ori
* @param override_railtype Whether all physically compatible railtypes should be followed.
* @return True if a path to a safe stopping tile could be reserved.
*/
static bool TryReserveSafeTrack(const Train *v, TileIndex tile, Trackdir td, bool override_tailtype)
static bool TryReserveSafeTrack(const Train *v, TileIndex tile, Trackdir td, bool override_railtype)
{
switch (_settings_game.pf.pathfinder_for_trains) {
case VPF_NPF: return NPFTrainFindNearestSafeTile(v, tile, td, override_tailtype);
case VPF_YAPF: return YapfTrainFindNearestSafeTile(v, tile, td, override_tailtype);
case VPF_NPF: return NPFTrainFindNearestSafeTile(v, tile, td, override_railtype);
case VPF_YAPF: return YapfTrainFindNearestSafeTile(v, tile, td, override_railtype);
default: NOT_REACHED();
}