Skip to content

Commit

Permalink
Replaced two if conditions by using std::abs
Browse files Browse the repository at this point in the history
  • Loading branch information
Timm Hoffmeister committed Jan 25, 2021
1 parent 959c03e commit 33a8374
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions libs/s25main/mapGenerator/HeadQuarters.h
Expand Up @@ -88,8 +88,7 @@ namespace rttr { namespace mapGenerator {
{
for(const MapPoint& pt : possiblePositions)
{
if(mountainDistance[pt] < allowedMountainDistance + 5
&& mountainDistance[pt] > allowedMountainDistance - 5)
if(std::abs(static_cast<int>(mountainDistance[pt] - allowedMountainDistance)) < 5)
{
positions.push_back(pt);
}
Expand Down

0 comments on commit 33a8374

Please sign in to comment.