summaryrefslogtreecommitdiff
path: root/src/road_cmd.cpp
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2008-01-17 19:49:06 +0000
committersmatz <smatz@openttd.org>2008-01-17 19:49:06 +0000
commit822242f4110b6e4188bca31599a23966be0b2dd4 (patch)
tree34528ac5e4eacd82e0b40b87f08e3bae4aa5c964 /src/road_cmd.cpp
parent35135222b56687a699181bf57271b0e2a08e1d32 (diff)
downloadopenttd-822242f4110b6e4188bca31599a23966be0b2dd4.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.cpp10
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;