(svn r3916) Get/Set the rail type by [GS]etRailType{Crossing,OnBridge,}()

This commit is contained in:
tron
2006-03-17 10:10:31 +00:00
parent d8677f1afa
commit 89090790c2
9 changed files with 68 additions and 51 deletions

View File

@@ -1256,12 +1256,10 @@ int32 DoConvertStationRail(TileIndex tile, uint totype, bool exec)
// tile is not a railroad station?
if (_m[tile].m5 >= 8) return CMD_ERROR;
// tile is already of requested type?
if (GB(_m[tile].m3, 0, 4) == totype) return CMD_ERROR;
if (GetRailType(tile) == totype) return CMD_ERROR;
if (exec) {
// change type.
SB(_m[tile].m3, 0, 4, totype);
SetRailType(tile, totype);
MarkTileDirtyByTile(tile);
}
@@ -1949,7 +1947,7 @@ static void DrawTile_Station(TileInfo *ti)
uint32 image;
const DrawTileSeqStruct *dtss;
const DrawTileSprites *t = NULL;
RailType railtype = GB(_m[ti->tile].m3, 0, 4);
RailType railtype = GetRailType(ti->tile);
const RailtypeInfo *rti = GetRailTypeInfo(railtype);
SpriteID offset;
uint32 relocation = 0;