From 3820e4f3db2ca23f7eeed7c3121cc41b0e12db25 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 23 May 2009 04:56:37 +0000 Subject: [PATCH] BGE PyController module reloading didnt check that the base of the function was a module (could be a class). --- source/gameengine/GameLogic/SCA_PythonController.cpp | 2 +- source/gameengine/Ketsji/KX_Scene.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/source/gameengine/GameLogic/SCA_PythonController.cpp b/source/gameengine/GameLogic/SCA_PythonController.cpp index 8140dbd53db..52f6bece132 100644 --- a/source/gameengine/GameLogic/SCA_PythonController.cpp +++ b/source/gameengine/GameLogic/SCA_PythonController.cpp @@ -336,7 +336,7 @@ bool SCA_PythonController::Import() PyObject *base= mod; for(unsigned int i=1; i < py_function_path.size(); i++) { - if(m_debug) { + if(m_debug && PyModule_Check(base)) { /* base could be a class */ Py_DECREF(base); /* getting a new one so dont hold a ref to the old one */ base= PyImport_ReloadModule(base); if (base==NULL) { diff --git a/source/gameengine/Ketsji/KX_Scene.cpp b/source/gameengine/Ketsji/KX_Scene.cpp index bb5e0875402..2c74c88dc14 100644 --- a/source/gameengine/Ketsji/KX_Scene.cpp +++ b/source/gameengine/Ketsji/KX_Scene.cpp @@ -1452,7 +1452,7 @@ void KX_Scene::LogicEndFrame() { m_logicmgr->EndFrame(); int numobj = m_euthanasyobjects->GetCount(); - int i; + KX_GameObject* obj; while ((numobj = m_euthanasyobjects->GetCount()) > 0)