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()).
This commit is contained in:
Campbell Barton
2009-05-17 16:30:18 +00:00
parent 65796e2c07
commit 41acd3b81c
7 changed files with 58 additions and 9 deletions

View File

@@ -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;