Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKester Maddock <Christopher.Maddock.1@uni.massey.ac.nz>2004-06-04 06:10:58 +0400
committerKester Maddock <Christopher.Maddock.1@uni.massey.ac.nz>2004-06-04 06:10:58 +0400
commit4ff321d50773166712a611233437c7b19183087c (patch)
tree8d7660ac9b3d23aec730730a57ce44a41141c70d /source/gameengine
parentf41c926a12eb41df81ee66f836cb6699cbf1a8f3 (diff)
Fix bug #1334: Crash with Python/GameEngine when the script has syntax errors.
When Python compile fails (eg syntax errors) skip the execute stage.
Diffstat (limited to 'source/gameengine')
-rw-r--r--source/gameengine/GameLogic/SCA_PythonController.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/source/gameengine/GameLogic/SCA_PythonController.cpp b/source/gameengine/GameLogic/SCA_PythonController.cpp
index c9ecb412035..2517870eb19 100644
--- a/source/gameengine/GameLogic/SCA_PythonController.cpp
+++ b/source/gameengine/GameLogic/SCA_PythonController.cpp
@@ -223,14 +223,14 @@ void SCA_PythonController::Trigger(SCA_LogicManager* logicmgr)
if (m_bytecode)
{
// store the
- int i=0;
- i+=2; // so compiler doesn't complain about unused variable
PyRun_SimpleString("import GameLogic\n");
} else
{
// didn't compile, so instead of compile, complain
- int i=0;
- i++; // so compiler doesn't complain about unused variable
+ // something is wrong, tell the user what went wrong
+ printf("PYTHON SCRIPT ERROR:\n");
+ PyRun_SimpleString(m_scriptText.Ptr());
+ return;
}
m_bModified=false;
}