Skip to content

Commit

Permalink
prevent simultaneous run and bribe
Browse files Browse the repository at this point in the history
  • Loading branch information
facundoolano committed May 23, 2021
1 parent 5d15133 commit fafca6a
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/game/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,12 @@ impl Game {
} else if self.pick_up_tombstone() {
return Ok(());
} else if let Some(mut enemy) = self.maybe_spawn_enemy() {
if bribe && self.bribe(&enemy) {
return Ok(());
}

if run && self.run_away(&enemy) {
// don't attempt bribe and run in the same turn
if bribe {
if self.bribe(&enemy) {
return Ok(());
}
} else if run && self.run_away(&enemy) {
return Ok(());
}

Expand Down

0 comments on commit fafca6a

Please # to comment.