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:
authorPorteries Tristan <republicthunderbolt9@gmail.com>2015-07-07 14:36:47 +0300
committerPorteries Tristan <republicthunderbolt9@gmail.com>2015-07-07 14:37:27 +0300
commit0c14a897dd92cba317f2466f39ef5782b823b31c (patch)
treefc61e4811061fdaecfe8a3d67dbdf976e84eb2f9 /source/gameengine/Ketsji/KX_GameObject.cpp
parent1d021956f595f02e16e332f8e27a6a17acaa3e13 (diff)
BGE: Fix wrong current logic manager in collision callback.
Diffstat (limited to 'source/gameengine/Ketsji/KX_GameObject.cpp')
-rw-r--r--source/gameengine/Ketsji/KX_GameObject.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp
index d98669cc5b4..eabe0765d3b 100644
--- a/source/gameengine/Ketsji/KX_GameObject.cpp
+++ b/source/gameengine/Ketsji/KX_GameObject.cpp
@@ -1583,6 +1583,14 @@ void KX_GameObject::RunCollisionCallbacks(KX_GameObject *collider, const MT_Vect
if (!m_collisionCallbacks || PyList_GET_SIZE(m_collisionCallbacks) == 0)
return;
+ /** Current logic controller is set by each python logic bricks before run,
+ * but if no python logic brick ran the logic manager can be wrong
+ * (if the user use muti scenes) and it will cause problems with function
+ * ConvertPythonToGameObject which use the current logic manager for object's name.
+ * Note: the scene is already set in logic frame loop.
+ */
+ SCA_ILogicBrick::m_sCurrentLogicManager = GetScene()->GetLogicManager();
+
PyObject *args[] = {collider->GetProxy(), PyObjectFrom(point), PyObjectFrom(normal)};
RunPythonCallBackList(m_collisionCallbacks, args, 1, ARRAY_SIZE(args));