Skip to content

Commit

Permalink
Minor Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Nereuxofficial committed Dec 10, 2022
1 parent f22df43 commit efb284d
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions game/src/machines/machine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,12 +185,10 @@ impl Machine {
/// * `player` - of type `& Player` is a reference to the player
pub(crate) fn interact(&mut self, player: &Player) -> RLResult {
// Check if there is a possible trade
let trade;
if let Some(t) = self.trades.iter().find(|t| t.initial_state == self.state) {
trade = t.clone();
} else {
return Ok(());
}
let trade = match self.trades.iter().find(|t| t.initial_state == self.state) {
Some(t) => t.clone(),
None => return Ok(()),
};

if trade.name == *"no_Trade" {
return Ok(());
Expand Down

0 comments on commit efb284d

Please sign in to comment.