Merge pull request #7705 from zii/patch-1

让replaceScene更安全
This commit is contained in:
minggo 2014-08-08 12:03:48 +08:00
commit 29888b9d74
1 changed files with 6 additions and 1 deletions

View File

@ -825,9 +825,14 @@ void Director::runWithScene(Scene *scene)
void Director::replaceScene(Scene *scene)
{
CCASSERT(_runningScene, "Use runWithScene: instead to start the director");
//CCASSERT(_runningScene, "Use runWithScene: instead to start the director");
CCASSERT(scene != nullptr, "the scene should not be null");
if (_runningScene == nullptr) {
runWithScene(scene);
return;
}
if (scene == _nextScene)
return;