Merge remote-tracking branch 'upstream/master'
This commit is contained in:
@@ -32,8 +32,13 @@ void CcBuildWagon(Commands, const CommandCost &result, VehicleID new_veh_id, uin
|
||||
|
||||
/* find a locomotive in the depot. */
|
||||
const Vehicle *found = nullptr;
|
||||
for (const Train *t : Train::Iterate()) {
|
||||
if (t->IsFrontEngine() && t->tile == tile && t->IsStoppedInDepot()) {
|
||||
/* The non-deterministic order returned from VehiclesOnTile() does not
|
||||
* matter here as there must only be one locomotive for anything to happen. */
|
||||
for (const Vehicle *v : VehiclesOnTile(tile)) {
|
||||
if (v->type != VEH_TRAIN) continue;
|
||||
|
||||
const Train *t = Train::From(v);
|
||||
if (t->IsFrontEngine() && t->IsStoppedInDepot()) {
|
||||
if (found != nullptr) return; // must be exactly one.
|
||||
found = t;
|
||||
}
|
||||
@@ -167,7 +172,7 @@ void DrawTrainImage(const Train *v, const Rect &r, VehicleID selection, EngineIm
|
||||
* the next engine after the highlight could overlap it. */
|
||||
int height = ScaleSpriteTrad(12);
|
||||
Rect hr = {highlight_l, 0, highlight_r, height - 1};
|
||||
DrawFrameRect(hr.Translate(r.left, CenterBounds(r.top, r.bottom, height)).Expand(WidgetDimensions::scaled.bevel), COLOUR_WHITE, FrameFlag::BorderOnly);
|
||||
DrawFrameRect(hr.Translate(r.left, CentreBounds(r.top, r.bottom, height)).Expand(WidgetDimensions::scaled.bevel), COLOUR_WHITE, FrameFlag::BorderOnly);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user