Fix concurrent access to entity list issue

This commit is contained in:
Yohann D'ANELLO 2020-11-19 01:13:46 +01:00
parent ae9258cb25
commit 038c2d0850

View File

@ -94,7 +94,7 @@ class Bomb(Item):
Special exploding action of the bomb
"""
if self.exploding:
for e in m.entities:
for e in m.entities.copy():
if abs(e.x - self.x) + abs(e.y - self.y) <= 1 and \
isinstance(e, FightingEntity):
e.take_damage(self, self.damage)