From 25cc638465f5454bd5fa7a18e0cd7621cdd6b8ea Mon Sep 17 00:00:00 2001 From: Tanner Collin Date: Sat, 19 Dec 2020 08:56:17 +0000 Subject: [PATCH] Fix bugs --- game.py | 2 +- jobs.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/game.py b/game.py index 137104e..46d56d5 100644 --- a/game.py +++ b/game.py @@ -288,7 +288,7 @@ class MCWorld: def find_monsters(self, center, distance): # finds monsters within distance result = [] - for eid, mob in self.g.mobs.items(): + for eid, mob in copy(self.g.mobs).items(): if mob.type not in mobs.EVIL_IDS: continue pos = utils.pint((mob.x, mob.y, mob.z)) diff --git a/jobs.py b/jobs.py index ee27866..adc91fe 100644 --- a/jobs.py +++ b/jobs.py @@ -788,7 +788,8 @@ class SleepWithBedStates: threats = w.find_threats(p, 30) if threats: - print('Waking up due to threats') + print('Waking up due to threats:') + print(threats) self.g.game.leave_bed() self.state = self.break_bed elif self.g.time < 100: @@ -1434,7 +1435,8 @@ class CheckThreatsStates: threats = w.find_threats(p, 40) if threats: - print('Found', len(threats), 'threats, fleeing') + print('Found', len(threats), 'threats, fleeing:') + print(threats) self.state = self.find_safety else: print('Aborting, no threats')