File diff r4076:ac684fc44bc2 → r4077:259c4c4aacad
npf.c
Show inline comments
 
@@ -210,15 +210,13 @@ static uint NPFSlopeCost(AyStarNode* cur
 
/**
 
 * Mark tiles by mowing the grass when npf debug level >= 1.
 
 * Will not work for multiplayer games, since it can (will) cause desyncs.
 
 */
 
static void NPFMarkTile(TileIndex tile)
 
{
 
#ifdef NO_DEBUG_MESSAGES
 
	return;
 
#else
 
#ifndef NO_DEBUG_MESSAGES
 
	if (_debug_npf_level < 1 || _networking) return;
 
	switch (GetTileType(tile)) {
 
		case MP_RAILWAY:
 
			/* DEBUG: mark visited tiles by mowing the grass under them ;-) */
 
			if (!IsTileDepotType(tile, TRANSPORT_RAIL)) {
 
				SetRailGroundType(tile, RAIL_GROUND_BARREN);
 
@@ -803,20 +801,18 @@ NPFFoundTargetData NPFRouteToDepotTrialE
 

	
 
	/* Initialize procs */
 
	_npf_aystar.CalculateH = NPFCalcStationOrTileHeuristic;
 
	_npf_aystar.EndNodeCheck = NPFFindStationOrTile;
 
	_npf_aystar.FoundEndNode = NPFSaveTargetData;
 
	_npf_aystar.GetNeighbours = NPFFollowTrack;
 
	if (type == TRANSPORT_RAIL)
 
		_npf_aystar.CalculateG = NPFRailPathCost;
 
	else if (type == TRANSPORT_ROAD)
 
		_npf_aystar.CalculateG = NPFRoadPathCost;
 
	else if (type == TRANSPORT_WATER)
 
		_npf_aystar.CalculateG = NPFWaterPathCost;
 
	else
 
		assert(0);
 
	switch (type) {
 
		default: NOT_REACHED();
 
		case TRANSPORT_RAIL:  _npf_aystar.CalculateG = NPFRailPathCost;  break;
 
		case TRANSPORT_ROAD:  _npf_aystar.CalculateG = NPFRoadPathCost;  break;
 
		case TRANSPORT_WATER: _npf_aystar.CalculateG = NPFWaterPathCost; break;
 
	}
 

	
 
	/* Initialize target */
 
	target.station_index = INVALID_STATION; /* We will initialize dest_coords inside the loop below */
 
	_npf_aystar.user_target = &target;
 

	
 
	/* Initialize user_data */