From 96908669acd7da2a99021bfdce9b60d924bc4e5e Mon Sep 17 00:00:00 2001 From: knoxHuang <821686174@qq.com> Date: Thu, 27 Oct 2016 21:48:55 +0800 Subject: [PATCH] fix isScheduled bug for fireball/issues/4543 --- cocos2d/core/CCScheduler.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cocos2d/core/CCScheduler.js b/cocos2d/core/CCScheduler.js index 57534798e0..0dde57d91b 100644 --- a/cocos2d/core/CCScheduler.js +++ b/cocos2d/core/CCScheduler.js @@ -778,7 +778,8 @@ cc.Scheduler = cc._Class.extend({ cc.assert(callback, "Argument callback must not be empty"); cc.assert(target, "Argument target must be non-nullptr"); - var element = this._hashForUpdates[getTargetId(target)]; + var instanceId = getTargetId(target); + var element = this._hashForTimers[instanceId]; if (!element){ return false; @@ -791,7 +792,7 @@ cc.Scheduler = cc._Class.extend({ for (var i = 0; i < timers.length; ++i){ var timer = timers[i]; - if (callback === timer.getKey()){ + if (callback === timer._selector){ return true; } }