Skip to content

Commit 696db30

Browse files
FlamefireFlow86
authored andcommitted
Introduce constant for max radius
1 parent 48e7f51 commit 696db30

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

libs/s25main/buildings/nobBaseMilitary.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,9 @@ MapPoint nobBaseMilitary::FindAnAttackerPlace(unsigned short& ret_radius, const
188188
// Check all points around the flag and take shortest
189189
unsigned min_length = std::numeric_limits<unsigned>::max();
190190
MapPoint minPt = MapPoint::Invalid();
191-
ret_radius = 100;
192-
for(const auto& node : world->GetPointsInRadius(flagPos, 3, ReturnMapPointWithRadius{}))
191+
constexpr auto MAX_RADIUS = 3;
192+
ret_radius = MAX_RADIUS;
193+
for(const auto& node : world->GetPointsInRadius(flagPos, MAX_RADIUS, ReturnMapPointWithRadius{}))
193194
{
194195
// We found a point with a better radius
195196
if(node.second > ret_radius)

0 commit comments

Comments
 (0)