summaryrefslogtreecommitdiff
path: root/src/economy.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/economy.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/economy.cpp')
-rw-r--r--src/economy.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/economy.cpp b/src/economy.cpp
index 9377a7a80..1156befb7 100644
--- a/src/economy.cpp
+++ b/src/economy.cpp
@@ -41,6 +41,7 @@
#include "sound_func.h"
#include "track_type.h"
#include "track_func.h"
+#include "road_func.h"
#include "rail_map.h"
#include "signal_func.h"
#include "gfx_func.h"
@@ -432,7 +433,9 @@ void ChangeOwnershipOfPlayerItems(PlayerID old_player, PlayerID new_player)
if (new_player != PLAYER_SPECTATOR) {
/* Update all signals because there can be new segment that was owned by two players
- * and signals were not propagated */
+ * and signals were not propagated
+ * Similiar with crossings - it is needed to bar crossings that weren't before
+ * because of different owner of crossing and approaching train */
tile = 0;
do {
@@ -442,6 +445,8 @@ void ChangeOwnershipOfPlayerItems(PlayerID old_player, PlayerID new_player)
Track track = RemoveFirstTrack(&tracks);
if (HasSignalOnTrack(tile, track)) AddTrackToSignalBuffer(tile, track, new_player);
} while (tracks != TRACK_BIT_NONE);
+ } else if (IsLevelCrossingTile(tile) && IsTileOwner(tile, new_player)) {
+ UpdateLevelCrossing(tile);
}
} while (++tile != MapSize());