1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-30 01:49:10 +00:00

Fix: [NewGRF] Default value of RailVehicleInfo::railveh_type was inconsistent with other default properties. (#9967)

If a NewGRF assigned neither "power" nor "dual-headed" properties,
then "railveh_type" defaulted to "singlehead-engine", while "power=0" said "it's a wagon".
This commit is contained in:
frosch
2022-08-26 20:50:33 +02:00
committed by GitHub
parent bba6ad1f4e
commit acf9d786f1

View File

@@ -76,6 +76,8 @@ Engine::Engine(VehicleType type, EngineID base)
/* Check if this base engine is within the original engine data range */
if (base >= _engine_counts[type]) {
/* 'power' defaults to zero, so we also have to default to 'wagon' */
if (type == VEH_TRAIN) this->u.rail.railveh_type = RAILVEH_WAGON;
/* Set model life to maximum to make wagons available */
this->info.base_life = 0xFF;
/* Set road vehicle tractive effort to the default value */