possible fix for ingnoring fishing holes

This commit is contained in:
Adam Saudagar 2021-05-15 17:52:04 +05:30
parent db3def3948
commit 810c0276a1

View File

@ -87,9 +87,8 @@ class Player(IMode):
if not self.engine.rotate_to(action[1][2]): if not self.engine.rotate_to(action[1][2]):
return return
# todo swap the order of below two lines
fishing_event.subscribe()
fishing_mode.subscribers.append(self._hole_complete_callback) fishing_mode.subscribers.append(self._hole_complete_callback)
fishing_event.subscribe()
# scan for fish hole # scan for fish hole
logging.info("scanning") logging.info("scanning")
# if found start fishing and wait for hole to complete # if found start fishing and wait for hole to complete
@ -101,8 +100,8 @@ class Player(IMode):
else: else:
logging.info("no hole found") logging.info("no hole found")
# continue when hole completes # continue when hole completes
fishing_event.unsubscribe()
fishing_mode.subscribers.remove(self._hole_complete_callback) fishing_mode.subscribers.remove(self._hole_complete_callback)
fishing_event.unsubscribe()
self.next() self.next()