Skip to content

Commit 2ee614e

Browse files
committed
minor optimization
1 parent d951902 commit 2ee614e

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

src/Geoscape/GeoscapeState.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1041,12 +1041,11 @@ void GeoscapeState::time10Minutes()
10411041

10421042
if ((*j)->getDestination() == 0)
10431043
{
1044+
double range = ((*j)->getRules()->getSightRange() * (1 / 60.0) * (M_PI / 180));
10441045
for(std::vector<AlienBase*>::iterator b = _game->getSavedGame()->getAlienBases()->begin(); b != _game->getSavedGame()->getAlienBases()->end(); b++)
10451046
{
1046-
double range = ((*j)->getRules()->getSightRange() * (1 / 60.0) * (M_PI / 180));
10471047
if ((*j)->getDistance(*b) <= range)
10481048
{
1049-
// TODO: move the detection range to the ruleset, or use the pre-defined one (which is 600, but detection range should be 500).
10501049
if (RNG::percent(50-((*j)->getDistance(*b) / range) * 50) && !(*b)->isDiscovered())
10511050
{
10521051
(*b)->setDiscovered(true);

0 commit comments

Comments
 (0)