File diff r8229:4262f8715f60 → r8230:33d57fce0ec2
src/waypoint.cpp
Show inline comments
 
@@ -160,14 +160,12 @@ CommandCost CmdBuildTrainWaypoint(TileIn
 
{
 
	Waypoint *wp;
 
	AutoPtrT<Waypoint> wp_auto_delete;
 
	Slope tileh;
 
	Axis axis;
 

	
 
	SET_EXPENSES_TYPE(EXPENSES_CONSTRUCTION);
 

	
 
	/* if custom gfx are used, make sure it is within bounds */
 
	if (p1 >= GetNumCustomStations(STAT_CLASS_WAYP)) return CMD_ERROR;
 

	
 
	if (!IsTileType(tile, MP_RAILWAY) ||
 
			GetRailTileType(tile) != RAIL_TILE_NORMAL || (
 
				(axis = AXIS_X, GetTrackBits(tile) != TRACK_BIT_X) &&
 
@@ -244,13 +242,13 @@ CommandCost CmdBuildTrainWaypoint(TileIn
 
		UpdateWaypointSign(wp);
 
		RedrawWaypointSign(wp);
 
		YapfNotifyTrackLayoutChange(tile, AxisToTrack(axis));
 
		wp_auto_delete.Detach();
 
	}
 

	
 
	return CommandCost(_price.build_train_depot);
 
	return CommandCost(EXPENSES_CONSTRUCTION, _price.build_train_depot);
 
}
 

	
 
/**
 
 * Daily loop for waypoints
 
 */
 
void WaypointsDailyLoop()
 
@@ -296,26 +294,25 @@ CommandCost RemoveTrainWaypoint(TileInde
 
			DoClearSquare(tile);
 
			SetSignalsOnBothDir(tile, track);
 
		}
 
		YapfNotifyTrackLayoutChange(tile, track);
 
	}
 

	
 
	return CommandCost(_price.remove_train_depot);
 
	return CommandCost(EXPENSES_CONSTRUCTION, _price.remove_train_depot);
 
}
 

	
 
/**
 
 * Delete a waypoint
 
 * @param tile tile where waypoint is to be deleted
 
 * @param flags type of operation
 
 * @param p1 unused
 
 * @param p2 unused
 
 * @return cost of operation or error
 
 */
 
CommandCost CmdRemoveTrainWaypoint(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
 
{
 
	SET_EXPENSES_TYPE(EXPENSES_CONSTRUCTION);
 
	return RemoveTrainWaypoint(tile, flags, true);
 
}
 

	
 
static bool IsUniqueWaypointName(const char *name)
 
{
 
	const Waypoint *wp;