Skip to content

Commit 9371662

Browse files
committed
Corrected a mistake of cc.Scheduler in _schedulePerFrame that the hasElement hasn't priority because it's an array.
1 parent 65e7ee4 commit 9371662

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

cocos2d/core/CCScheduler.js

+3-4
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ cc.ListEntry = function (prev, next, callback, target, priority, paused, markedF
5959
* A update entry list
6060
* @Class
6161
* @name cc.HashUpdateEntry
62-
* @param {cc.ListEntry} list Which list does it belong to ?
62+
* @param {Array} list Which list does it belong to ?
6363
* @param {cc.ListEntry} entry entry in the list
6464
* @param {cc.Class} target hash key (retained)
6565
* @param {function} callback
@@ -193,7 +193,6 @@ cc.Timer = cc.Class.extend(/** @lends cc.Timer# */{
193193
});
194194

195195
cc.TimerTargetSelector = cc.Timer.extend({
196-
197196
_target: null,
198197
_selector: null,
199198

@@ -326,9 +325,9 @@ cc.Scheduler = cc.Class.extend(/** @lends cc.Scheduler# */{
326325

327326
_schedulePerFrame: function(callback, target, priority, paused){
328327
var hashElement = this._hashForUpdates[target.__instanceId];
329-
if (hashElement){
328+
if (hashElement && hashElement.entry){
330329
// check if priority has changed
331-
if (hashElement.list.priority !== priority){
330+
if (hashElement.entry.priority !== priority){
332331
if (this._updateHashLocked){
333332
cc.log("warning: you CANNOT change update priority in scheduled function");
334333
hashElement.entry.markedForDeletion = false;

0 commit comments

Comments
 (0)