[Bf-blender-cvs] [0c14a89] master: BGE: Fix wrong current logic manager in collision callback.
Porteries Tristan
noreply at git.blender.org
Tue Jul 7 13:38:05 CEST 2015
Commit: 0c14a897dd92cba317f2466f39ef5782b823b31c
Author: Porteries Tristan
Date: Tue Jul 7 13:36:47 2015 +0200
Branches: master
https://developer.blender.org/rB0c14a897dd92cba317f2466f39ef5782b823b31c
BGE: Fix wrong current logic manager in collision callback.
===================================================================
M source/gameengine/Ketsji/KX_GameObject.cpp
===================================================================
diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp
index d98669c..eabe076 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));
More information about the Bf-blender-cvs
mailing list