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

Compare commits

..

3 Commits

Author SHA1 Message Date
519fe33175 Fix ab1a4c6c: Changing baseset/playlist while shuffle is on does not change song. (#11510)
The change-playlist function relied on toggling shuffle to restart playing which is no longer the case, so always handle it when changing playlist instead.
2023-11-28 17:44:31 +00:00
e3924f3231 Fix #10811: Allow dragging vehicle in depot to any free row. (#11508) 2023-11-28 13:52:36 +00:00
e6d132d24b Fix #10926: New free wagons no longer split by type. (#11507)
NormalizeTrainVehInDepot() should only be called if an engine was built, not for wagons.
2023-11-28 13:48:09 +00:00
4 changed files with 5 additions and 10 deletions

View File

@@ -460,11 +460,9 @@ struct DepotWindow : Window {
ym = (y - matrix_widget->pos_y) % this->resize.step_height;
int row = this->vscroll->GetScrolledRowFromWidget(y, this, WID_D_MATRIX);
if (row == INT_MAX) return MODE_ERROR;
uint pos = (row * this->num_columns) + xt;
if (this->vehicle_list.size() + this->wagon_list.size() <= pos) {
if (row == INT_MAX || this->vehicle_list.size() + this->wagon_list.size() <= pos) {
/* Clicking on 'line' / 'block' without a vehicle */
if (this->type == VEH_TRAIN) {
/* End the dragging */

View File

@@ -156,12 +156,8 @@ void MusicSystem::ChangePlaylist(PlaylistChoices pl)
this->selected_playlist = pl;
this->playlist_position = 0;
if (_settings_client.music.shuffle) {
this->Shuffle();
/* Shuffle() will also Play() if necessary, only start once */
} else if (_settings_client.music.playing) {
this->Play();
}
if (_settings_client.music.shuffle) this->Shuffle();
if (_settings_client.music.playing) this->Play();
}
InvalidateWindowData(WC_MUSIC_TRACK_SELECTION, 0);

View File

@@ -689,6 +689,7 @@ static CommandCost CmdBuildRailWagon(DoCommandFlag flags, TileIndex tile, const
/** Move all free vehicles in the depot to the train */
void NormalizeTrainVehInDepot(const Train *u)
{
assert(u->IsEngine());
for (const Train *v : Train::Iterate()) {
if (v->IsFreeWagon() && v->tile == u->tile &&
v->track == TRACK_BIT_DEPOT) {

View File

@@ -172,7 +172,7 @@ std::tuple<CommandCost, VehicleID, uint, uint16_t, CargoArray> CmdBuildVehicle(D
}
if (flags & DC_EXEC) {
if (type == VEH_TRAIN && use_free_vehicles && !(flags & DC_AUTOREPLACE)) {
if (type == VEH_TRAIN && use_free_vehicles && !(flags & DC_AUTOREPLACE) && Train::From(v)->IsEngine()) {
/* Move any free wagons to the new vehicle. */
NormalizeTrainVehInDepot(Train::From(v));
}