Making KX_GameObject names read only.
This was committed in revision 2832 but never accounted for existing object name hashes which existed since revision 2. Its possible to update the names elsewhere but unlikely anyone ever used this successfully so removing.
This commit is contained in:
@@ -1279,8 +1279,14 @@ int KX_GameObject::_setattr(const char *attr, PyObject *value) // _setattr metho
|
||||
{
|
||||
if (!strcmp(attr, "name"))
|
||||
{
|
||||
#if 0 // was added in revision 2832, but never took into account Object name mappings from revision 2
|
||||
// unlikely anyone ever used this successfully , removing.
|
||||
m_name = PyString_AsString(value);
|
||||
return 0;
|
||||
#else
|
||||
PyErr_SetString(PyExc_AttributeError, "object name readonly");
|
||||
return 1;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -7,7 +7,7 @@ class KX_GameObject:
|
||||
|
||||
Properties assigned to game objects are accessible as attributes of this class.
|
||||
|
||||
@ivar name: The object's name.
|
||||
@ivar name: The object's name. (Read only)
|
||||
@type name: string.
|
||||
@ivar mass: The object's mass (provided the object has a physics controller). Read only.
|
||||
@type mass: float
|
||||
|
Reference in New Issue
Block a user