Skip to content

Commit

Permalink
✨ Add current_organic_passed_required_distance function
Browse files Browse the repository at this point in the history
  • Loading branch information
rster2002 committed Aug 9, 2024
1 parent caf7b6e commit 8396cc8
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,19 @@ impl JournalCommanderEntry {
})
.min_by(|a, b| a.partial_cmp(b).unwrap_or(Ordering::Equal))
}

/// Returns true when the player is far enough from previous scans for the current organic.
/// Returns None if the player has not scanned a species on the current planet.
pub fn current_organic_passed_required_distance(&self) -> Option<bool> {
let required_distance = self.log_state
.current_organic_progress
.as_ref()?
.species
.genus()
.minimum_distance();

let current_distance = self.current_organic_distance()?;

Some(current_distance >= required_distance as f32)
}
}
1 change: 1 addition & 0 deletions src/modules/status/models/flags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ impl Flags {
self.0 & 1073741824 != 0
}

/// Whether the SRV has the high beam lights active.
pub fn srv_high_beam(&self) -> bool {
self.0 & 2147483648 != 0
}
Expand Down

0 comments on commit 8396cc8

Please sign in to comment.