station_cmd.c
changeset 5116 3c0c3da214ca
parent 5103 fbd04229cae3
child 5216 8bd14ee39af2
equal deleted inserted replaced
5115:c489d3854de5 5116:3c0c3da214ca
  1356 	// tile is not a railroad station?
  1356 	// tile is not a railroad station?
  1357 	if (!IsRailwayStation(tile)) return CMD_ERROR;
  1357 	if (!IsRailwayStation(tile)) return CMD_ERROR;
  1358 
  1358 
  1359 	if (GetRailType(tile) == totype) return CMD_ERROR;
  1359 	if (GetRailType(tile) == totype) return CMD_ERROR;
  1360 
  1360 
       
  1361 	// 'hidden' elrails can't be downgraded to normal rail when elrails are disabled
       
  1362 	if (_patches.disable_elrails && totype == RAILTYPE_RAIL && GetRailType(tile) == RAILTYPE_ELECTRIC) return CMD_ERROR;
       
  1363 
  1361 	if (exec) {
  1364 	if (exec) {
  1362 		SetRailType(tile, totype);
  1365 		SetRailType(tile, totype);
  1363 		MarkTileDirtyByTile(tile);
  1366 		MarkTileDirtyByTile(tile);
  1364 		YapfNotifyTrackLayoutChange(tile, GetRailStationTrack(tile));
  1367 		YapfNotifyTrackLayoutChange(tile, GetRailStationTrack(tile));
  1365 	}
  1368 	}