summaryrefslogtreecommitdiff
path: root/subscriber.py
diff options
context:
space:
mode:
authorFlorian Jung <flo@windfisch.org>2015-08-24 18:52:36 +0200
committerFlorian Jung <flo@windfisch.org>2015-08-24 18:52:36 +0200
commit8a44a7c1f11211d56d54c185dc8fdc90e35f221b (patch)
tree072eaa27b648377bdadd308ab7774ee27ad6ddeb /subscriber.py
parentc2e13a67d969f1208a8b8c127c94a9841c7048d9 (diff)
draw the direction where ejected mass would fly
Diffstat (limited to 'subscriber.py')
-rw-r--r--subscriber.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/subscriber.py b/subscriber.py
index 1dcccc6..feddf04 100644
--- a/subscriber.py
+++ b/subscriber.py
@@ -95,4 +95,14 @@ class EnhancingSubscriber(DummySubscriber):
self.history[cid].stale = False
self.history = {k: v for k, v in self.history.items() if v.stale == False}
+
+ for cid in self.c.world.cells:
+ cell = self.c.world.cells[cid]
+ try:
+ oldpos = cell.poslog[-3-1]
+ cell.movement = (cell.pos - oldpos)/3
+ except (AttributeError, IndexError):
+ # no oldpos available
+ cell.movement = None
+ pass