Skip to content

Commit 83791d4

Browse files
FlamefireFlow86
authored andcommitted
Use has_value instead of nullopt comparison
1 parent 819edc8 commit 83791d4

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

libs/s25main/figures/nofHunter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ void nofHunter::WalkedDerived()
211211
bool nofHunter::IsShootingPointGood(const MapPoint pt)
212212
{
213213
// Punkt muss betretbar sein und man muss ihn erreichen können
214-
return PathConditionHuman(*world).IsNodeOk(pt) && world->FindHumanPath(this->pos, pt, 6) != std::nullopt;
214+
return PathConditionHuman(*world).IsNodeOk(pt) && world->FindHumanPath(this->pos, pt, 6).has_value();
215215
}
216216

217217
void nofHunter::HandleStateChasing()

libs/s25main/world/GameWorld.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -994,7 +994,7 @@ bool GameWorld::ValidWaitingAroundBuildingPoint(const MapPoint pt, const MapPoin
994994
return false;
995995
}
996996
// object wall or impassable terrain increasing my path to target length to a higher value than the direct distance?
997-
return FindHumanPath(pt, center, CalcDistance(pt, center)) != std::nullopt;
997+
return FindHumanPath(pt, center, CalcDistance(pt, center)).has_value();
998998
}
999999

10001000
bool GameWorld::IsValidPointForFighting(MapPoint pt, const nofActiveSoldier& soldier,

0 commit comments

Comments
 (0)