File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ use rand::Rng;
1111/// The distance from home will influence the enemy frequency and level.
1212/// Under certain conditions, special (quest-related) enemies may be spawned.
1313pub fn spawn ( location : & location:: Location , player : & Character ) -> Option < Character > {
14- if location . is_home ( ) || player. enemies_evaded ( ) {
14+ if player. enemies_evaded ( ) {
1515 return None ;
1616 }
1717
Original file line number Diff line number Diff line change @@ -96,8 +96,10 @@ impl Game {
9696 while self . location != * dest {
9797 self . visit ( self . location . go_to ( dest) ) ?;
9898
99- if let Some ( mut enemy) = enemy:: spawn ( & self . location , & self . player ) {
100- return self . battle ( & mut enemy, run, bribe) ;
99+ if !self . location . is_home ( ) {
100+ if let Some ( mut enemy) = enemy:: spawn ( & self . location , & self . player ) {
101+ return self . battle ( & mut enemy, run, bribe) ;
102+ }
101103 }
102104 }
103105 Ok ( ( ) )
Original file line number Diff line number Diff line change @@ -53,7 +53,6 @@ impl Chest {
5353 if gold_chest {
5454 chest. gold = game. player . gold_gained ( game. player . level + distance. len ( ) ) ;
5555 }
56-
5756 if equipment_chest {
5857 let ( sword, shield) = random_equipment ( game. player . rounded_level ( ) ) ;
5958 chest. sword = sword;
You can’t perform that action at this time.
0 commit comments