From ea680e37e970330cbaee1f5a9229e10faa39183c Mon Sep 17 00:00:00 2001 From: Porteries Tristan Date: Thu, 23 Feb 2017 19:48:05 +0000 Subject: [PATCH] UPBGE: Fix documentation for deprecated joystick.[hatValues/numHats]. hatValues return an empty list instead of rasing an error now. --- doc/python_api/rst/bge_types/bge.types.SCA_PythonJoystick.rst | 4 ++-- source/gameengine/GameLogic/SCA_PythonJoystick.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/python_api/rst/bge_types/bge.types.SCA_PythonJoystick.rst b/doc/python_api/rst/bge_types/bge.types.SCA_PythonJoystick.rst index e473b3497ad3..b600ec268e95 100644 --- a/doc/python_api/rst/bge_types/bge.types.SCA_PythonJoystick.rst +++ b/doc/python_api/rst/bge_types/bge.types.SCA_PythonJoystick.rst @@ -37,7 +37,7 @@ base class --- :class:`PyObjectPlus` * up:[0.0, -1.0, ...] * down:[0.0, 1.0, ...] - .. attribute:: hatValues (Deprecated. Use :data:activeButtons instead) + .. attribute:: hatValues (Deprecated. Use :data:`activeButtons` instead) The state of the joysticks hats as a list of values :data:`numHats` long. (read-only). @@ -69,7 +69,7 @@ base class --- :class:`PyObjectPlus` :type: integer - .. attribute:: numHats (Deprecated. Use :data:numButtons instead) + .. attribute:: numHats (Deprecated. Use :data:`numButtons` instead) The number of hats for the joystick at this index. (read-only). diff --git a/source/gameengine/GameLogic/SCA_PythonJoystick.cpp b/source/gameengine/GameLogic/SCA_PythonJoystick.cpp index 0862a6d8c507..454ed2cad592 100644 --- a/source/gameengine/GameLogic/SCA_PythonJoystick.cpp +++ b/source/gameengine/GameLogic/SCA_PythonJoystick.cpp @@ -145,7 +145,7 @@ PyObject* SCA_PythonJoystick::pyattr_get_active_buttons(PyObjectPlus *self_v, co PyObject* SCA_PythonJoystick::pyattr_get_hat_values(PyObjectPlus *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { ShowDeprecationWarning("SCA_PythonJoystick.hatValues", "SCA_PythonJoystick.activeButtons"); - return nullptr; + return PyList_New(0); } PyObject* SCA_PythonJoystick::pyattr_get_axis_values(PyObjectPlus *self_v, const KX_PYATTRIBUTE_DEF *attrdef)