diff options
author | rubidium <rubidium@openttd.org> | 2007-05-25 08:13:01 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2007-05-25 08:13:01 +0000 |
commit | 0819f3a9a0229186fbd0624f590764553c7e7178 (patch) | |
tree | 20cb72fbcb2123cac75bfc9f3a06d9e590278b3a /src/roadveh_cmd.cpp | |
parent | d5d94e230fe92fe461becdf9043034651141ab73 (diff) | |
download | openttd-0819f3a9a0229186fbd0624f590764553c7e7178.tar.xz |
(svn r9917) -Codechange: prepare some more areas for more road types.
Diffstat (limited to 'src/roadveh_cmd.cpp')
-rw-r--r-- | src/roadveh_cmd.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/roadveh_cmd.cpp b/src/roadveh_cmd.cpp index 4a5c73b1f..a331c430f 100644 --- a/src/roadveh_cmd.cpp +++ b/src/roadveh_cmd.cpp @@ -173,9 +173,6 @@ int32 CmdBuildRoadVeh(TileIndex tile, uint32 flags, uint32 p1, uint32 p2) v->u.road.state = RVSB_IN_DEPOT; v->vehstatus = VS_HIDDEN | VS_STOPPED | VS_DEFPAL; - v->u.road.roadtype = ROADTYPE_ROAD; - v->u.road.compatible_roadtypes = RoadTypeToRoadTypes(v->u.road.roadtype); - v->spritenum = rvi->image_index; v->cargo_type = rvi->cargo_type; v->cargo_subtype = 0; @@ -194,6 +191,9 @@ int32 CmdBuildRoadVeh(TileIndex tile, uint32 flags, uint32 p1, uint32 p2) v->max_speed = rvi->max_speed; v->engine_type = (byte)p1; + v->u.road.roadtype = HASBIT(EngInfo(v->engine_type)->misc_flags, EF_ROAD_TRAM) ? ROADTYPE_TRAM : ROADTYPE_ROAD; + v->u.road.compatible_roadtypes = RoadTypeToRoadTypes(v->u.road.roadtype); + e = GetEngine(p1); v->reliability = e->reliability; v->reliability_spd_dec = e->reliability_spd_dec; @@ -1064,7 +1064,7 @@ static Trackdir RoadFindPathToDest(Vehicle* v, TileIndex tile, DiagDirection ent TrackdirBits trackdirs = (TrackdirBits)GB(r, 0, 16); if (IsTileType(tile, MP_STREET)) { - if (GetRoadTileType(tile) == ROAD_TILE_DEPOT && (!IsTileOwner(tile, v->owner) || GetRoadDepotDirection(tile) == enterdir)) { + if (GetRoadTileType(tile) == ROAD_TILE_DEPOT && (!IsTileOwner(tile, v->owner) || GetRoadDepotDirection(tile) == enterdir || (GetRoadTypes(tile) & v->u.road.compatible_roadtypes) == 0)) { /* Road depot owned by another player or with the wrong orientation */ trackdirs = TRACKDIR_BIT_NONE; } |