BGE Py API
use PY_SET_ATTR_FAIL and PY_SET_ATTR_SUCCESS return values so the fake subclassing can know if a value failed to be set or if it was missing from the type. (with PY_SET_ATTR_MISSING) Also noticed some other mistakes. - KX_LightObject, setting the type didnt check for an int. - KX_SoundActuator, didnt return an error when assigning an invalid orientation value - KX_GameObject, worldOrientation didnt return an error value.
This commit is contained in:
@@ -563,14 +563,14 @@ int SCA_PythonController::pyattr_set_script(void *self_v, const KX_PYATTRIBUTE_D
|
||||
|
||||
if (scriptArg==NULL) {
|
||||
PyErr_SetString(PyExc_TypeError, "controller.script = string: Python Controller, expected a string script text");
|
||||
return -1;
|
||||
return PY_SET_ATTR_FAIL;
|
||||
}
|
||||
|
||||
/* set scripttext sets m_bModified to true,
|
||||
so next time the script is needed, a reparse into byte code is done */
|
||||
self->SetScriptText(scriptArg);
|
||||
|
||||
return 0;
|
||||
return PY_SET_ATTR_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user