diff options
author | smatz <smatz@openttd.org> | 2008-01-17 19:49:06 +0000 |
---|---|---|
committer | smatz <smatz@openttd.org> | 2008-01-17 19:49:06 +0000 |
commit | b20d1eee6cb4bd7282f66a324dd65332de9d9ec1 (patch) | |
tree | 34528ac5e4eacd82e0b40b87f08e3bae4aa5c964 /src/road_cmd.cpp | |
parent | e0f759f71e82ce2c68438b91646e35c29b44d85b (diff) | |
download | openttd-b20d1eee6cb4bd7282f66a324dd65332de9d9ec1.tar.xz |
(svn r11908) -Fix: update crossing when merging a company, when building a crossing and after loading older savegame
Diffstat (limited to 'src/road_cmd.cpp')
-rw-r--r-- | src/road_cmd.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/road_cmd.cpp b/src/road_cmd.cpp index dcb3871c6..ee530a225 100644 --- a/src/road_cmd.cpp +++ b/src/road_cmd.cpp @@ -32,6 +32,7 @@ #include "vehicle_func.h" #include "vehicle_base.h" #include "sound_func.h" +#include "road_func.h" #include "table/sprites.h" #include "table/strings.h" @@ -486,6 +487,7 @@ CommandCost CmdBuildRoad(TileIndex tile, uint32 flags, uint32 p1, uint32 p2) YapfNotifyTrackLayoutChange(tile, FindFirstTrack(GetTrackBits(tile))); /* Always add road to the roadtypes (can't draw without it) */ MakeRoadCrossing(tile, _current_player, _current_player, _current_player, GetTileOwner(tile), roaddir, GetRailType(tile), RoadTypeToRoadTypes(rt) | ROADTYPES_ROAD, p2); + UpdateLevelCrossing(tile); MarkTileDirtyByTile(tile); } return CommandCost(EXPENSES_CONSTRUCTION, _price.build_road * (rt == ROADTYPE_ROAD ? 2 : 4)); @@ -1343,11 +1345,9 @@ static VehicleEnterTileStatus VehicleEnter_Road(Vehicle *v, TileIndex tile, int { switch (GetRoadTileType(tile)) { case ROAD_TILE_CROSSING: - if (v->type == VEH_TRAIN && !IsCrossingBarred(tile)) { - /* train crossing a road */ - SndPlayVehicleFx(SND_0E_LEVEL_CROSSING, v); - BarCrossing(tile); - MarkTileDirtyByTile(tile); + if (v->type == VEH_TRAIN) { + /* it should be barred */ + assert(IsCrossingBarred(tile)); } break; |