Revision: 16245
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=16245
Author:   campbellbarton
Date:     2008-08-25 11:52:38 +0200 (Mon, 25 Aug 2008)

Log Message:
-----------
getting the last created object would return an object that had no SG_Node 
which would crash whenever python tried to get its location.
since the object was removed from the scene anyway, there is no reason to 
return it.

Modified Paths:
--------------
    trunk/blender/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp

Modified: trunk/blender/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp
===================================================================
--- trunk/blender/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp 
2008-08-25 06:22:21 UTC (rev 16244)
+++ trunk/blender/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp 
2008-08-25 09:52:38 UTC (rev 16245)
@@ -377,7 +377,10 @@
                                                                                
                                   PyObject* kwds)
 {
        SCA_IObject* result = this->GetLastCreatedObject();
-       if (result)
+       
+       // if result->GetSGNode() is NULL
+       // it means the object has ended, The BGE python api crashes in many 
places if the object is returned.
+       if (result && (static_cast<KX_GameObject *>(result))->GetSGNode()) 
        {
                result->AddRef();
                return result;


_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to