(svn r4769) - Newstations: add newstations ttdpatch flag
authorpeter1138
Sun, 07 May 2006 11:41:44 +0000
changeset 3777 bffc9d12cfba
parent 3776 1a8d467577f4
child 3778 1d32787783cf
(svn r4769) - Newstations: add newstations ttdpatch flag
newgrf.c
rail_cmd.c
--- a/newgrf.c	Sun May 07 11:40:53 2006 +0000
+++ b/newgrf.c	Sun May 07 11:41:44 2006 +0000
@@ -2476,6 +2476,7 @@
 	                   | (1 << 0x1C); /* electrifiedrailway */
 
 	_ttdpatch_flags[2] = (_patches.build_on_slopes ? (1 << 0x0D) : 0)       /* buildonslopes */
+	                   | (1 << 0x12)  /* newstations */
 	                   | (_patches.build_on_slopes ? (1 << 0x15) : 0)       /* buildoncoasts */
 	                   | (1 << 0x16)  /* canals */
 	                   | (1 << 0x17)  /* newstartyear */
--- a/rail_cmd.c	Sun May 07 11:40:53 2006 +0000
+++ b/rail_cmd.c	Sun May 07 11:41:44 2006 +0000
@@ -852,7 +852,7 @@
 {
 	if (!CheckTileOwnership(tile)) return CMD_ERROR;
 
-	if (!EnsureNoVehicle(tile) && (!IsCompatibleRail(GetRailType(tile), totype) || IsPlainRailTile(tile))) return CMD_ERROR;
+	if (!(EnsureNoVehicle(tile) || (GetRailType(tile) == RAILTYPE_RAIL && totype == RAILTYPE_ELECTRIC)) && (!IsCompatibleRail(GetRailType(tile), totype) || IsPlainRailTile(tile))) return CMD_ERROR;
 
 	// tile is already of requested type?
 	if (GetRailType(tile) == totype) return CMD_ERROR;