mirror of https://github.com/OpenTTD/OpenTTD
(svn r4924) - Backport from trunk (r4906):
Refresh build vehicle window (if opened) when converting rail depotrelease/0.4
parent
5c8bd4b143
commit
f5e0e18dca
10
rail_cmd.c
10
rail_cmd.c
|
@ -10,6 +10,7 @@
|
||||||
#include "tile.h"
|
#include "tile.h"
|
||||||
#include "vehicle.h"
|
#include "vehicle.h"
|
||||||
#include "viewport.h"
|
#include "viewport.h"
|
||||||
|
#include "window.h"
|
||||||
#include "command.h"
|
#include "command.h"
|
||||||
#include "pathfind.h"
|
#include "pathfind.h"
|
||||||
#include "engine.h"
|
#include "engine.h"
|
||||||
|
@ -985,6 +986,15 @@ static int32 DoConvertRail(TileIndex tile, uint totype, bool exec)
|
||||||
if (exec) {
|
if (exec) {
|
||||||
SB(_m[tile].m3, 0, 4, totype);
|
SB(_m[tile].m3, 0, 4, totype);
|
||||||
MarkTileDirtyByTile(tile);
|
MarkTileDirtyByTile(tile);
|
||||||
|
|
||||||
|
/* Update build vehicle window related to this depot */
|
||||||
|
if (IsTileDepotType(tile, TRANSPORT_RAIL)) {
|
||||||
|
Window *w = FindWindowById(WC_BUILD_VEHICLE, tile);
|
||||||
|
if (w != NULL) {
|
||||||
|
WP(w,buildtrain_d).railtype = totype;
|
||||||
|
SetWindowDirty(w);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return _price.build_rail / 2;
|
return _price.build_rail / 2;
|
||||||
|
|
Loading…
Reference in New Issue