diff options
author | Campbell Barton <ideasman42@gmail.com> | 2009-05-17 20:30:18 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2009-05-17 20:30:18 +0400 |
commit | 41acd3b81cd2a7156b8c5ced4d4aa257e7575517 (patch) | |
tree | dcb2c099c3ed09f0d6b736000cb7cbf922118c45 /source/gameengine/GameLogic | |
parent | 65796e2c0712798606497dfb3f36ccbd6e7ab725 (diff) |
While testing YoFrankie with the new API attributes found some issues...
- corrections to docs
- disallow calling controller.activate(actuator) when the controller is not active. (Raise a SystemError)
- Added 2 new attributes, CValue.name - deprecates CValue.getName(), KX_GameObject.children deprecated KX_GameObject.getChildren(), (same for getChildrenRecursive()).
Diffstat (limited to 'source/gameengine/GameLogic')
-rw-r--r-- | source/gameengine/GameLogic/SCA_PythonController.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/source/gameengine/GameLogic/SCA_PythonController.cpp b/source/gameengine/GameLogic/SCA_PythonController.cpp index 212366e6526..abb3b36b91e 100644 --- a/source/gameengine/GameLogic/SCA_PythonController.cpp +++ b/source/gameengine/GameLogic/SCA_PythonController.cpp @@ -494,6 +494,11 @@ int SCA_PythonController::py_setattro(PyObject *attr, PyObject *value) PyObject* SCA_PythonController::PyActivate(PyObject *value) { + if(m_sCurrentController != this) { + PyErr_SetString(PyExc_SystemError, "Cannot add an actuator from a non-active controller"); + return NULL; + } + SCA_IActuator* actu = LinkedActuatorFromPy(value); if(actu==NULL) return NULL; @@ -504,6 +509,11 @@ PyObject* SCA_PythonController::PyActivate(PyObject *value) PyObject* SCA_PythonController::PyDeActivate(PyObject *value) { + if(m_sCurrentController != this) { + PyErr_SetString(PyExc_SystemError, "Cannot add an actuator from a non-active controller"); + return NULL; + } + SCA_IActuator* actu = LinkedActuatorFromPy(value); if(actu==NULL) return NULL; |