From 04acf7e45d08878733b0d0a0d65f319f6d14d224 Mon Sep 17 00:00:00 2001 From: Florian Jung Date: Wed, 2 Mar 2016 15:26:22 +0100 Subject: ugly hack: only run gui+strategy on world updates --- subscriber.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'subscriber.py') diff --git a/subscriber.py b/subscriber.py index 164257b..7ebe375 100644 --- a/subscriber.py +++ b/subscriber.py @@ -120,6 +120,12 @@ class EnhancingSubscriber(DummySubscriber): self.history = {} self.time = 0 self.victims = {} + self.newFrame = False + + def isNewFrame(self): + tmp = self.newFrame + self.newFrame = False + return tmp def set_client(self,c): self.c = c @@ -148,6 +154,8 @@ class EnhancingSubscriber(DummySubscriber): pass def on_world_update_post(self): + self.newFrame = True + self.c.world.time = self.time self.time += 1 -- cgit v1.2.3