Skip to content

Commit

Permalink
Remove unused parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
idshibanov committed Sep 8, 2020
1 parent c0dfd18 commit 1b2868d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions src/fheroes2/world/world_pathfinding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ std::list<Route::Step> Pathfinder::buildPath( int from, int target, uint8_t skil
std::list<Route::Step> path;

// check if we have to re-cache the map (new hero selected, etc)
reEvaluateIfNeeded( from, skill, target );
reEvaluateIfNeeded( from, skill );

// trace the path from end point
int currentNode = target;
Expand Down Expand Up @@ -122,14 +122,14 @@ bool Pathfinder::isBlockedByObject( int from, int target, bool fromWater )

uint32_t Pathfinder::getDistance( int from, int target, uint8_t skill )
{
reEvaluateIfNeeded( from, skill, target );
reEvaluateIfNeeded( from, skill );
return _cache[target]._cost;
}

void Pathfinder::reEvaluateIfNeeded( int from, uint8_t skill, int destination )
void Pathfinder::reEvaluateIfNeeded( int from, uint8_t skill )
{
if ( _pathStart != from || _pathfindingSkill != skill ) {
evaluateMap( from, skill, destination );
evaluateMap( from, skill );
}
}

Expand All @@ -147,7 +147,7 @@ uint32_t Pathfinder::getMovementPenalty( int from, int target, int direction, ui
}

// Destination is optional
void Pathfinder::evaluateMap( int start, uint8_t skill, int destination )
void Pathfinder::evaluateMap( int start, uint8_t skill )
{
const Directions directions = Direction::All();
const bool fromWater = world.GetTiles( start ).isWater();
Expand Down
4 changes: 2 additions & 2 deletions src/fheroes2/world/world_pathfinding.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@ class Pathfinder
public:
Pathfinder() {}
void reset();
void evaluateMap( int start, uint8_t skill, int destination = -1 );
void evaluateMap( int start, uint8_t skill );
std::list<Route::Step> buildPath( int from, int target, uint8_t skill = Skill::Level::NONE );
uint32_t getDistance( int from, int target, uint8_t skill = Skill::Level::NONE );
uint32_t getMovementPenalty( int from, int target, int direction, uint8_t skill = Skill::Level::NONE );
bool isBlockedByObject( int from, int target, bool fromWater = false );

private:
void reEvaluateIfNeeded( int from, uint8_t skill, int destination = -1 );
void reEvaluateIfNeeded( int from, uint8_t skill );

std::vector<PathfindingNode> _cache;
int _pathStart = -1;
Expand Down

0 comments on commit 1b2868d

Please sign in to comment.