From 6b3a43ccb4c3d9cc385d1f2acaac2d4d39ce25df Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 20 Jun 2015 20:02:16 +1000 Subject: BGE: dissallow calling reverse on internal clists --- source/gameengine/Expressions/ListValue.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'source/gameengine') diff --git a/source/gameengine/Expressions/ListValue.cpp b/source/gameengine/Expressions/ListValue.cpp index 5e0eb92eb58..58e571042d8 100644 --- a/source/gameengine/Expressions/ListValue.cpp +++ b/source/gameengine/Expressions/ListValue.cpp @@ -583,7 +583,8 @@ PyObject *CListValue::Pyappend(PyObject *value) return NULL; if (!BGE_PROXY_PYOWNS(m_proxy)) { - PyErr_SetString(PyExc_TypeError, "CList.append(i): this CValueList is used internally for the game engine and can't be modified"); + PyErr_SetString(PyExc_TypeError, + "CList.append(i): internal values can't be modified"); return NULL; } @@ -594,6 +595,12 @@ PyObject *CListValue::Pyappend(PyObject *value) PyObject *CListValue::Pyreverse() { + if (!BGE_PROXY_PYOWNS(m_proxy)) { + PyErr_SetString(PyExc_TypeError, + "CList.reverse(): internal values can't be modified"); + return NULL; + } + std::reverse(m_pValueArray.begin(),m_pValueArray.end()); Py_RETURN_NONE; } -- cgit v1.2.3