summaryrefslogtreecommitdiff
path: root/subscriber.py
diff options
context:
space:
mode:
authorFlorian Jung <flo@windfisch.org>2015-08-31 18:41:04 +0200
committerFlorian Jung <flo@windfisch.org>2015-08-31 18:41:04 +0200
commitebcc40249233959a6fbc743adc6df7c22ca8cf16 (patch)
treeb5ac82999fd65fb3d56a54b7fa22561ded3bc410 /subscriber.py
parent1b71192eca047f8d13d6570bb623627389e5acc3 (diff)
Demonstrate that on_cell_eaten gets called for unknown cellsdemonstrate_on_cell_eaten_issue
Diffstat (limited to 'subscriber.py')
-rw-r--r--subscriber.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/subscriber.py b/subscriber.py
index ecec729..e11fbb5 100644
--- a/subscriber.py
+++ b/subscriber.py
@@ -99,8 +99,11 @@ class EnhancingSubscriber(DummySubscriber):
del self.victims[eater]
def on_cell_eaten(self, eater_id, eaten_id):
- if eater_id in self.c.world.cells and self.c.world.cells[eater_id].is_virus:
- print("virus ate something!")
+ if eater_id in self.c.world.cells:
+ if self.c.world.cells[eater_id].is_virus:
+ print("virus ate something!")
+ else:
+ print("eater is not in world.cells, da fuq?")
if eater_id not in self.victims:
self.victims[eater_id] = []