Fix bugs
This commit is contained in:
parent
cdd71d2610
commit
25cc638465
2
game.py
2
game.py
|
@ -288,7 +288,7 @@ class MCWorld:
|
||||||
def find_monsters(self, center, distance):
|
def find_monsters(self, center, distance):
|
||||||
# finds monsters within distance
|
# finds monsters within distance
|
||||||
result = []
|
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:
|
if mob.type not in mobs.EVIL_IDS:
|
||||||
continue
|
continue
|
||||||
pos = utils.pint((mob.x, mob.y, mob.z))
|
pos = utils.pint((mob.x, mob.y, mob.z))
|
||||||
|
|
6
jobs.py
6
jobs.py
|
@ -788,7 +788,8 @@ class SleepWithBedStates:
|
||||||
|
|
||||||
threats = w.find_threats(p, 30)
|
threats = w.find_threats(p, 30)
|
||||||
if threats:
|
if threats:
|
||||||
print('Waking up due to threats')
|
print('Waking up due to threats:')
|
||||||
|
print(threats)
|
||||||
self.g.game.leave_bed()
|
self.g.game.leave_bed()
|
||||||
self.state = self.break_bed
|
self.state = self.break_bed
|
||||||
elif self.g.time < 100:
|
elif self.g.time < 100:
|
||||||
|
@ -1434,7 +1435,8 @@ class CheckThreatsStates:
|
||||||
threats = w.find_threats(p, 40)
|
threats = w.find_threats(p, 40)
|
||||||
|
|
||||||
if threats:
|
if threats:
|
||||||
print('Found', len(threats), 'threats, fleeing')
|
print('Found', len(threats), 'threats, fleeing:')
|
||||||
|
print(threats)
|
||||||
self.state = self.find_safety
|
self.state = self.find_safety
|
||||||
else:
|
else:
|
||||||
print('Aborting, no threats')
|
print('Aborting, no threats')
|
||||||
|
|
Loading…
Reference in New Issue
Block a user