Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMitchell Stokes <mogurijin@gmail.com>2014-03-25 04:57:02 +0400
committerMitchell Stokes <mogurijin@gmail.com>2014-03-25 04:57:02 +0400
commitb66a9543bbcf86646b46af1da7ed0c4d035c7f98 (patch)
treecd5d607571dd9983eea2759d9623acbcbe291942 /source/gameengine/Converter/KX_BlenderSceneConverter.cpp
parenta2c002acb9e7771645c25203576e1bd09a84561a (diff)
Fix T38929: BGE: Strange behaving from addObject after trying to add an nonexisting overlay scene
If bge.logic.addScene() could not find the scene to add it would add the first scene again, which is just silly. Now, if no scene is found, a warning is printed and nothing is added.
Diffstat (limited to 'source/gameengine/Converter/KX_BlenderSceneConverter.cpp')
-rw-r--r--source/gameengine/Converter/KX_BlenderSceneConverter.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/source/gameengine/Converter/KX_BlenderSceneConverter.cpp b/source/gameengine/Converter/KX_BlenderSceneConverter.cpp
index c0c28d15ad3..854e9fe7327 100644
--- a/source/gameengine/Converter/KX_BlenderSceneConverter.cpp
+++ b/source/gameengine/Converter/KX_BlenderSceneConverter.cpp
@@ -233,8 +233,7 @@ Scene *KX_BlenderSceneConverter::GetBlenderSceneForName(const STR_String& name)
Scene *sce;
/**
- * Find the specified scene by name, or the first
- * scene if nothing matches (shouldn't happen).
+ * Find the specified scene by name, or NULL if nothing matches.
*/
if ((sce= (Scene *)BLI_findstring(&m_maggie->scene, name.ReadPtr(), offsetof(ID, name) + 2)))
return sce;
@@ -246,7 +245,7 @@ Scene *KX_BlenderSceneConverter::GetBlenderSceneForName(const STR_String& name)
return sce;
}
- return (Scene*)m_maggie->scene.first;
+ return NULL;
}