diff options
author | Darkvater <Darkvater@openttd.org> | 2006-03-14 23:28:04 +0000 |
---|---|---|
committer | Darkvater <Darkvater@openttd.org> | 2006-03-14 23:28:04 +0000 |
commit | 3fd42fab5db59e2d76470f8dce6b0f6238a98501 (patch) | |
tree | 5fe9a10c78a82d7e9f88b1d12aafd66c25bee1b7 | |
parent | 19dee66a265eef14ac25e594fd8fbd992f46724e (diff) | |
download | openttd-3fd42fab5db59e2d76470f8dce6b0f6238a98501.tar.xz |
(svn r3876) - Fix: We know on a level crossing's town owner of the road (if any); it is in m2 so properly set it back when the crossing's removed.
-rw-r--r-- | rail_cmd.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/rail_cmd.c b/rail_cmd.c index 1456e85a0..7c8468034 100644 --- a/rail_cmd.c +++ b/rail_cmd.c @@ -427,6 +427,7 @@ int32 CmdRemoveSingleRail(int x, int y, uint32 flags, uint32 p1, uint32 p2) break; case MP_STREET: { + uint town; if (!IsLevelCrossing(tile)) return CMD_ERROR; /* This is a crossing, let's check if the direction is correct */ @@ -435,7 +436,8 @@ int32 CmdRemoveSingleRail(int x, int y, uint32 flags, uint32 p1, uint32 p2) if (!(flags & DC_EXEC)) return _price.remove_rail; - MakeRoadNormal(tile, _m[tile].m3, GetCrossingRoadBits(tile), 0); + town = (_m[tile].m3 == OWNER_TOWN) ? _m[tile].m2 : 0; + MakeRoadNormal(tile, _m[tile].m3, GetCrossingRoadBits(tile), town); break; } |