Merge branch 'master' into jgrpp

# Conflicts:
#	src/ai/ai_gui.cpp
#	src/build_vehicle_gui.cpp
#	src/genworld_gui.cpp
#	src/lang/english.txt
#	src/lang/german.txt
#	src/lang/korean.txt
#	src/newgrf_sound.cpp
#	src/roadveh.h
#	src/sound.cpp
#	src/station_cmd.cpp
#	src/train.h
#	src/train_cmd.cpp
#	src/vehicle.cpp
#	src/vehicle_base.h
#	src/vehicle_gui.cpp
This commit is contained in:
Jonathan G Rennison
2022-11-26 23:04:04 +00:00
100 changed files with 1304 additions and 825 deletions

View File

@@ -3199,7 +3199,7 @@ bool Train::FindClosestDepot(TileIndex *location, DestinationID *destination, bo
}
/** Play a sound for a train leaving the station. */
void Train::PlayLeaveStationSound() const
void Train::PlayLeaveStationSound(bool force) const
{
static const SoundFx sfx[] = {
SND_04_DEPARTURE_STEAM,
@@ -3209,10 +3209,9 @@ void Train::PlayLeaveStationSound() const
SND_41_DEPARTURE_MAGLEV
};
if (PlayVehicleSound(this, VSE_START)) return;
if (PlayVehicleSound(this, VSE_START, force)) return;
EngineID engtype = this->engine_type;
SndPlayVehicleFx(sfx[RailVehInfo(engtype)->engclass], this);
SndPlayVehicleFx(sfx[RailVehInfo(this->engine_type)->engclass], this);
}
/**
@@ -7410,3 +7409,20 @@ void ApplySignalTrainAdaptationSpeed(Train *v, TileIndex tile, uint16 track)
v->signal_speed_restriction = 0;
}
}
uint16 Train::GetMaxWeight() const
{
uint16 weight = CargoSpec::Get(this->cargo_type)->WeightOfNUnitsInTrain(this->GetEngine()->DetermineCapacity(this));
/* Vehicle weight is not added for articulated parts. */
if (!this->IsArticulatedPart()) {
weight += GetVehicleProperty(this, PROP_TRAIN_WEIGHT, RailVehInfo(this->engine_type)->weight);
}
/* Powered wagons have extra weight added. */
if (HasBit(this->flags, VRF_POWEREDWAGON)) {
weight += RailVehInfo(this->gcache.first_engine)->pow_wag_weight;
}
return weight;
}