From ae3e2400801946b64b79f9aa06b0076939e004b5 Mon Sep 17 00:00:00 2001 From: AlgorithmX2 Date: Tue, 11 Feb 2014 22:43:17 -0600 Subject: [PATCH] Fixed Alertable --- me/cache/TickManagerCache.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/me/cache/TickManagerCache.java b/me/cache/TickManagerCache.java index e49e359c..758d2fa1 100644 --- a/me/cache/TickManagerCache.java +++ b/me/cache/TickManagerCache.java @@ -109,8 +109,12 @@ public class TickManagerCache implements ITickManager if ( tt == null ) throw new RuntimeException( "Invalid Alertted device, this node is not marked as alertable, or part of this grid." ); - tt.lastTick = -tt.request.maxTickRate; - addToQueue( tt ); + // set to awake, this is for sanity. + sleeping.remove( node ); + awake.put( node, tt ); + + tt.lastTick = tt.lastTick - tt.request.maxTickRate; + upcomingTicks.add( tt ); return true; }