Fixing script callbacks for schedule updates with negative and positive priorities

This commit is contained in:
Rohan Kuruvilla 2012-11-02 10:22:28 -07:00 committed by James Chen
parent 605771697a
commit af3bc76062
1 changed files with 12 additions and 0 deletions

View File

@ -771,6 +771,12 @@ void CCScheduler::update(float dt)
{ {
if ((! pEntry->paused) && (! pEntry->markedForDeletion)) if ((! pEntry->paused) && (! pEntry->markedForDeletion))
{ {
CCScriptEngineProtocol* pEngine = CCScriptEngineManager::sharedManager()->getScriptEngine();
if (pEngine != NULL && kScriptTypeJavascript == pEngine->getScriptType())
{
CCScriptEngineManager::sharedManager()->getScriptEngine()->executeSchedule(NULL, dt, (CCNode *)pEntry->target);
}
pEntry->target->update(dt); pEntry->target->update(dt);
} }
} }
@ -795,6 +801,12 @@ void CCScheduler::update(float dt)
{ {
if ((! pEntry->paused) && (! pEntry->markedForDeletion)) if ((! pEntry->paused) && (! pEntry->markedForDeletion))
{ {
CCScriptEngineProtocol* pEngine = CCScriptEngineManager::sharedManager()->getScriptEngine();
if (pEngine != NULL && kScriptTypeJavascript == pEngine->getScriptType())
{
CCScriptEngineManager::sharedManager()->getScriptEngine()->executeSchedule(NULL, dt, (CCNode *)pEntry->target);
}
pEntry->target->update(dt); pEntry->target->update(dt);
} }
} }