summaryrefslogtreecommitdiff
path: root/subscriber.py
diff options
context:
space:
mode:
Diffstat (limited to 'subscriber.py')
-rw-r--r--subscriber.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/subscriber.py b/subscriber.py
index 4327e04..ecec729 100644
--- a/subscriber.py
+++ b/subscriber.py
@@ -99,8 +99,9 @@ class EnhancingSubscriber(DummySubscriber):
del self.victims[eater]
def on_cell_eaten(self, eater_id, eaten_id):
- if self.c.world.cells[eater_id].is_virus:
+ if eater_id in self.c.world.cells and self.c.world.cells[eater_id].is_virus:
print("virus ate something!")
+
if eater_id not in self.victims:
self.victims[eater_id] = []