diff options
author | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2010-08-09 15:32:55 +0400 |
---|---|---|
committer | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2010-08-09 15:32:55 +0400 |
commit | dd75ec490761640571a0d8e53a0d439091f2736f (patch) | |
tree | 25b3966862febbf3ee8c81ed45f7045c99f84016 /source/gameengine/GameLogic | |
parent | 02b0967bd11dd6fd2454b37182d9f94ea451b603 (diff) | |
parent | c026b8066ddc1c42144d2e5132384ea7c1211050 (diff) |
Merged changes in the trunk up to revision 31190.
Diffstat (limited to 'source/gameengine/GameLogic')
-rw-r--r-- | source/gameengine/GameLogic/CMakeLists.txt | 1 | ||||
-rw-r--r-- | source/gameengine/GameLogic/SCA_PythonController.cpp | 12 |
2 files changed, 9 insertions, 4 deletions
diff --git a/source/gameengine/GameLogic/CMakeLists.txt b/source/gameengine/GameLogic/CMakeLists.txt index 3ffba14ec95..93183dafeee 100644 --- a/source/gameengine/GameLogic/CMakeLists.txt +++ b/source/gameengine/GameLogic/CMakeLists.txt @@ -49,4 +49,3 @@ ELSE(WITH_PYTHON) ENDIF(WITH_PYTHON) BLENDERLIB(bf_logic "${SRC}" "${INC}") -#env.BlenderLib ( 'bf_logic', sources, Split(incs), [], libtype=['game','player'], priority=[30, 110] ) diff --git a/source/gameengine/GameLogic/SCA_PythonController.cpp b/source/gameengine/GameLogic/SCA_PythonController.cpp index bcc61b533c3..48fdcb3eb44 100644 --- a/source/gameengine/GameLogic/SCA_PythonController.cpp +++ b/source/gameengine/GameLogic/SCA_PythonController.cpp @@ -305,7 +305,7 @@ bool SCA_PythonController::Import() char *function_string; function_string= strrchr(mod_path, '.'); - + if(function_string == NULL) { printf("Python module name formatting error \"%s\":\n\texpected \"SomeModule.Func\", got \"%s\"\n", GetName().Ptr(), m_scriptText.Ptr()); return false; @@ -316,11 +316,17 @@ bool SCA_PythonController::Import() // Import the module and print an error if it's not found PyObject *mod = PyImport_ImportModule(mod_path); - if(mod && m_debug) + + if (mod == NULL) { + ErrorPrint("Python module can't be imported"); + return false; + } + + if(m_debug) mod = PyImport_ReloadModule(mod); if (mod == NULL) { - ErrorPrint("Python module not found"); + ErrorPrint("Python module can't be reloaded"); return false; } |