(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.
authorDarkvater
Tue, 14 Mar 2006 23:28:04 +0000
changeset 3208 a0cf0c614729
parent 3207 231948813b05
child 3209 98153d2f1ba7
(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.
rail_cmd.c
--- a/rail_cmd.c	Tue Mar 14 22:58:46 2006 +0000
+++ b/rail_cmd.c	Tue Mar 14 23:28:04 2006 +0000
@@ -427,6 +427,7 @@
 			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 @@
 			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;
 		}