mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-11 13:10:45 +00:00
Fix #8733: Can't buy train engine when the "Engines only" filter is active
This commit is contained in:
parent
3cb2dd4889
commit
9c5a7d3a57
@ -1472,7 +1472,7 @@ struct BuildVehicleWindow : Window {
|
|||||||
if (sel_eng != INVALID_ENGINE) {
|
if (sel_eng != INVALID_ENGINE) {
|
||||||
CommandCallback *callback = (this->vehicle_type == VEH_TRAIN && RailVehInfo(sel_eng)->railveh_type == RAILVEH_WAGON) ? CcBuildWagon : CcBuildPrimaryVehicle;
|
CommandCallback *callback = (this->vehicle_type == VEH_TRAIN && RailVehInfo(sel_eng)->railveh_type == RAILVEH_WAGON) ? CcBuildWagon : CcBuildPrimaryVehicle;
|
||||||
CargoID cargo = this->cargo_filter[this->cargo_filter_criteria];
|
CargoID cargo = this->cargo_filter[this->cargo_filter_criteria];
|
||||||
if (cargo == CF_ANY) cargo = CF_NONE;
|
if (cargo == CF_ANY || cargo == CF_ENGINES) cargo = CF_NONE;
|
||||||
DoCommandP(this->window_number, sel_eng | (cargo << 24), 0, GetCmdBuildVeh(this->vehicle_type), callback);
|
DoCommandP(this->window_number, sel_eng | (cargo << 24), 0, GetCmdBuildVeh(this->vehicle_type), callback);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user