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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user