1
0
Fork 0

Compare commits

...

4 Commits

Author SHA1 Message Date
ArtiomGusev 0838f936d5
Merge 4c7ea26238 into 03672ed8eb 2025-07-18 11:04:57 +00:00
Jonathan G Rennison 03672ed8eb
Fix: EngineImageType mismatch between sizing and drawing in preview window (#14455) 2025-07-18 07:02:46 -04:00
ArtiomGusev 4c7ea26238 Fix: Prevent duplicate train reversal when already reversing 2025-06-01 13:00:14 +03:00
ArtiomGusev e46456d605 Fix: Prevent duplicate train reversal when already reversing 2025-06-01 12:40:00 +03:00
2 changed files with 7 additions and 1 deletions

View File

@ -84,7 +84,7 @@ struct EnginePreviewWindow : Window {
/* Get size of engine sprite, on loan from depot_gui.cpp */ /* Get size of engine sprite, on loan from depot_gui.cpp */
EngineID engine = static_cast<EngineID>(this->window_number); EngineID engine = static_cast<EngineID>(this->window_number);
EngineImageType image_type = EIT_PURCHASE; EngineImageType image_type = EIT_PREVIEW;
uint x, y; uint x, y;
int x_offs, y_offs; int x_offs, y_offs;

View File

@ -1991,6 +1991,8 @@ static bool IsWholeTrainInsideDepot(const Train *v)
*/ */
void ReverseTrainDirection(Train *v) void ReverseTrainDirection(Train *v)
{ {
//DEBUG(driver, 1, "Reversing train %d on tile %d", v->index, v->tile);
if (IsRailDepotTile(v->tile)) { if (IsRailDepotTile(v->tile)) {
if (IsWholeTrainInsideDepot(v)) return; if (IsWholeTrainInsideDepot(v)) return;
InvalidateWindowData(WC_VEHICLE_DEPOT, v->tile); InvalidateWindowData(WC_VEHICLE_DEPOT, v->tile);
@ -3884,6 +3886,9 @@ static TileIndex TrainApproachingCrossingTile(const Train *v)
*/ */
static bool TrainCheckIfLineEnds(Train *v, bool reverse) static bool TrainCheckIfLineEnds(Train *v, bool reverse)
{ {
if (v->flags.Test(VehicleRailFlag::Reversing)) return false;
/* First, handle broken down train */ /* First, handle broken down train */
int t = v->breakdown_ctr; int t = v->breakdown_ctr;
@ -3933,6 +3938,7 @@ static bool TrainCheckIfLineEnds(Train *v, bool reverse)
} }
static bool TrainLocoHandler(Train *v, bool mode) static bool TrainLocoHandler(Train *v, bool mode)
{ {
/* train has crashed? */ /* train has crashed? */