Merge tag '12.0-beta1' into jgrpp-beta

# Conflicts:
#	CMakeLists.txt
#	bin/ai/CMakeLists.txt
#	bin/game/CMakeLists.txt
#	src/build_vehicle_gui.cpp
#	src/console_cmds.cpp
#	src/core/overflowsafe_type.hpp
#	src/fios.cpp
#	src/lang/english.txt
#	src/lang/german.txt
#	src/lang/korean.txt
#	src/lang/polish.txt
#	src/network/core/game_info.cpp
#	src/network/core/game_info.h
#	src/network/core/tcp_game.cpp
#	src/network/core/tcp_game.h
#	src/network/network.cpp
#	src/network/network_client.cpp
#	src/network/network_client.h
#	src/network/network_coordinator.cpp
#	src/network/network_gui.cpp
#	src/network/network_server.cpp
#	src/network/network_server.h
#	src/newgrf_engine.cpp
#	src/openttd.cpp
#	src/rev.cpp.in
#	src/settings_type.h
#	src/train.h
#	src/train_cmd.cpp
This commit is contained in:
Jonathan G Rennison
2021-11-02 17:51:38 +00:00
146 changed files with 2391 additions and 2807 deletions

View File

@@ -111,6 +111,7 @@ struct TrainCache {
/* cached values, recalculated on load and each time a vehicle is added to/removed from the consist. */
TrainCacheFlags cached_tflags;///< train cached flags
int cached_curve_speed_mod; ///< curve speed modifier of the entire train
uint8 cached_num_engines; ///< total number of engines, including rear ends of multiheaded engines
uint16 cached_centre_mass; ///< Cached position of the centre of mass, from the front
uint16 cached_veh_weight; ///< Cached individual vehicle weight
@@ -452,6 +453,15 @@ protected: // These functions should not be called outside acceleration code.
return GetRailTypeInfo(GetRailTypeByTrackBit(this->tile, this->track))->max_speed;
}
/**
* Returns the curve speed modifier of this vehicle.
* @return Current curve speed modifier, in fixed-point binary representation with 8 fractional bits.
*/
inline int GetCurveSpeedModifier() const
{
return GetVehicleProperty(this, PROP_TRAIN_CURVE_SPEED_MOD, RailVehInfo(this->engine_type)->curve_speed_mod, true);
}
/**
* Checks if the vehicle is at a tile that can be sloped.
* @return True if the tile can be sloped.