mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-08-21 21:49:10 +00:00
Compare commits
3 Commits
3df7d1aff9
...
519fe33175
Author | SHA1 | Date | |
---|---|---|---|
519fe33175 | |||
e3924f3231 | |||
e6d132d24b |
@@ -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 */
|
||||
|
@@ -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);
|
||||
|
@@ -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) {
|
||||
|
@@ -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));
|
||||
}
|
||||
|
Reference in New Issue
Block a user