Changeset - r14882:868b30887683
[Not reviewed]
master
0 1 0
alberth - 15 years ago 2010-03-20 17:08:16
alberth@openttd.org
(svn r19488) -Codechange: Use last_error data for removal in CmdRailTrackHelper() as well.
1 file changed with 0 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/rail_cmd.cpp
Show inline comments
 
@@ -780,25 +780,24 @@ static CommandCost CmdRailTrackHelper(Ti
 
			total_cost.AddCost(ret);
 
		}
 

	
 
		if (tile == end_tile) break;
 

	
 
		tile += ToTileIndexDiff(_trackdelta[trackdir]);
 

	
 
		/* toggle railbit for the non-diagonal tracks */
 
		if (!IsDiagonalTrackdir(trackdir)) ToggleBit(trackdir, 0);
 
	}
 

	
 
	if (had_success) return total_cost;
 
	if (remove) return CMD_ERROR;
 
	return last_error;
 
}
 

	
 
/** Build rail on a stretch of track.
 
 * Stub for the unified rail builder/remover
 
 * @param tile start tile of drag
 
 * @param flags operation to perform
 
 * @param p1 end tile of drag
 
 * @param p2 various bitstuffed elements
 
 * - p2 = (bit 0-3) - railroad type normal/maglev (0 = normal, 1 = mono, 2 = maglev)
 
 * - p2 = (bit 4-6) - track-orientation, valid values: 0-5 (Track enum)
 
 * - p2 = (bit 7)   - 0 = build, 1 = remove tracks
0 comments (0 inline, 0 general)