Changeset - r28716:9010c20e8915
[Not reviewed]
master
0 1 0
Tyler Trahan - 3 months ago 2024-02-08 14:46:55
tyler@tylertrahan.com
Cleanup: Remove unnecessary Trackdir casts (#12038)
1 file changed with 3 insertions and 3 deletions:
0 comments (0 inline, 0 general)
src/pathfinder/npf/npf.cpp
Show inline comments
 
@@ -323,7 +323,7 @@ static int32_t NPFWaterPathCost(AyStar *
 
		cost += _settings_game.pf.npf.npf_buoy_penalty; // A small penalty for going over buoys
 
	}
 

	
 
	if (current->direction != NextTrackdir((Trackdir)parent->path.node.direction)) {
 
	if (current->direction != NextTrackdir(parent->path.node.direction)) {
 
		cost += _settings_game.pf.npf.npf_water_curve_penalty;
 
	}
 

	
 
@@ -527,7 +527,7 @@ static int32_t NPFRailPathCost(AyStar *a
 
	cost += NPFSlopeCost(current);
 

	
 
	/* Check for turns */
 
	if (current->direction != NextTrackdir((Trackdir)parent->path.node.direction)) {
 
	if (current->direction != NextTrackdir(parent->path.node.direction)) {
 
		cost += _settings_game.pf.npf.npf_rail_curve_penalty;
 
	}
 
	/* TODO, with realistic acceleration, also the amount of straight track between
 
@@ -1321,7 +1321,7 @@ Track NPFTrainChooseTrack(const Train *v
 

	
 
	if (target != nullptr) {
 
		target->tile = ftd.node.tile;
 
		target->trackdir = (Trackdir)ftd.node.direction;
 
		target->trackdir = ftd.node.direction;
 
		target->okay = ftd.res_okay;
 
	}
 

	
0 comments (0 inline, 0 general)