diff options
author | Campbell Barton <ideasman42@gmail.com> | 2008-08-16 04:06:51 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2008-08-16 04:06:51 +0400 |
commit | 1ffede887211c748d4426d6e68f179dac5a5bcfd (patch) | |
tree | 5e560a3bbb8f18a15c2cabec74dd1302b6136bd8 /source | |
parent | 528722f4726908ff47653b39a8a16589e5401003 (diff) |
SCA_PythonController.cpp - Made errors in python print the controller name, useful when blender crashes on printing the python error which happens frequently.
buttons_logic.c - NULL checks for game logic buttons, linking in groups with some logic links to objects outsude the group could crash blender. There are NULL checks for this case elsewhere so I assume it should be supported.
CMakeLists.txt - remove YESIAMSTUPID option, is not used anymore.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/src/buttons_logic.c | 6 | ||||
-rw-r--r-- | source/gameengine/GameLogic/SCA_PythonController.cpp | 4 |
2 files changed, 6 insertions, 4 deletions
diff --git a/source/blender/src/buttons_logic.c b/source/blender/src/buttons_logic.c index 8788363c19b..cdb66714573 100644 --- a/source/blender/src/buttons_logic.c +++ b/source/blender/src/buttons_logic.c @@ -3183,7 +3183,8 @@ void logic_buts(void) while(cont) { for (iact=0; iact<cont->totlinks; iact++) { act = cont->links[iact]; - act->flag |= ACT_LINKED; + if (act) + act->flag |= ACT_LINKED; } controller_state_mask |= cont->state_mask; cont = cont->next; @@ -3231,7 +3232,8 @@ void logic_buts(void) /* this controller is visible, mark all its actuator */ for (iact=0; iact<cont->totlinks; iact++) { act = cont->links[iact]; - act->flag |= ACT_VISIBLE; + if (act) + act->flag |= ACT_VISIBLE; } uiBlockSetEmboss(block, UI_EMBOSSM); uiDefIconButBitS(block, TOG, CONT_DEL, B_DEL_CONT, ICON_X, xco, yco, 22, 19, &cont->flag, 0, 0, 0, 0, "Delete Controller"); diff --git a/source/gameengine/GameLogic/SCA_PythonController.cpp b/source/gameengine/GameLogic/SCA_PythonController.cpp index cd1b029fc34..f9081c90288 100644 --- a/source/gameengine/GameLogic/SCA_PythonController.cpp +++ b/source/gameengine/GameLogic/SCA_PythonController.cpp @@ -248,7 +248,7 @@ void SCA_PythonController::Trigger(SCA_LogicManager* logicmgr) { // didn't compile, so instead of compile, complain // something is wrong, tell the user what went wrong - printf("PYTHON SCRIPT ERROR:\n"); + printf("Python compile error from controller \"%s\": \n", GetName().Ptr()); //PyRun_SimpleString(m_scriptText.Ptr()); PyErr_Print(); return; @@ -285,7 +285,7 @@ void SCA_PythonController::Trigger(SCA_LogicManager* logicmgr) else { // something is wrong, tell the user what went wrong - printf("PYTHON SCRIPT ERROR:\n"); + printf("Python script error from controller \"%s\": \n", GetName().Ptr()); PyErr_Print(); //PyRun_SimpleString(m_scriptText.Ptr()); } |