The old way was bad because it was calling PyList_Size on an PyObject
which was not yet verified to be a list, and it should have raised
value error when arg was a list, but not the right length
* rulesets/Py_BBox.cpp, rulesets/Py_Location.cpp, rulesets/Py_Map.cpp,
rulesets/Py_Mind.cpp, rulesets/Py_Object.cpp,
rulesets/Py_Operation.cpp, rulesets/Py_Oplist.cpp,
rulesets/Py_Optime.cpp, rulesets/Py_Quaternion.cpp,
rulesets/Py_RootEntity.cpp, rulesets/Py_Task.cpp,
rulesets/Py_Thing.cpp, rulesets/Py_World.cpp,
rulesets/Python_API.cpp: Replace calls to PyMem_DEL with calls
to PyObject_Free. Thanks to Kai for doing most of the digging
on this one.
* rulesets/Py_BBox.cpp, rulesets/Py_Statistics.cpp,
rulesets/Python_API.cpp: Replace calls to the cyphesis log
system with Python exceptions.
* rulesets/Py_Mind.cpp: Accept map and list atlas attributes on
the mind object.
* rulesets/Py_Property.cpp: Improve the wording of some log messags.
* rulesets/Py_RootEntity.cpp: Assert that attributes work correctly.
* rulesets/Plant.cpp: Add FIXME about an issue with plants eating
people.
* rulesets/Py_BBox.cpp: Add method exposing boxSquareBoundingRadius
to python.
* rulesets/Task.cpp, rulesets/Task.h: Add method to generate the
next tick for this task, using a given interval. Fix setting
progress and rate, so both can be zero.
* rulesets/Py_Task.cpp: Expose nextTick() method to python.
Allow rate to be set as an integer from python, so it can be zero.
* rulesets/mason/world/tasks/Combat.py: Use next_tick() for all
tick ops.
* rulesets/mason/world/tasks/Logging.py,
rulesets/mason/world/tasks/Raise.py,
rulesets/mason/world/tasks/Ram.py,
rulesets/mason/world/tasks/Sharpen.py: Add range checks, and use
next_tick() to simplify tick op generation.
* rulesets/Py_BBox.cpp, rulesets/Py_Optime.cpp,
rulesets/Py_Statistics.cpp, rulesets/Py_Thing.cpp: Ensure that
setattr returns an exception if the attribute is not a valid one.
* rulesets/Py_Map.cpp, rulesets/Py_Point3D.cpp,
rulesets/Py_Quaternion.cpp, rulesets/Py_World.cpp,
rulesets/Py_WorldTime.cpp: Remove setattr, as no attributes can
be set on this type.
* rulesets/Py_Mind.cpp, rulesets/Py_Oplist.cpp,
rulesets/Py_Vector3D.cpp: Clean up type structure.
* rulesets/basic/mind/goals/common/move.py: Remove attempt
to set "rotation" attribute on location, as its obsolete
and pointless.
* rulesets/Py_BBox.cpp, rulesets/Py_Location.cpp,
rulesets/Python_API.cpp: Eliminate some raw stderr output,
and replace with python errors, and calls to the log subsystem.
* client/Py_CreatorClient.cpp, client/Py_CreatorClient.h,
rulesets/Py_BBox.cpp, rulesets/Py_BBox.h, rulesets/Py_Location.cpp,
rulesets/Py_Location.h, rulesets/Py_Map.cpp, rulesets/Py_Map.h,
rulesets/Py_Mind.cpp, rulesets/Py_Mind.h, rulesets/Py_Object.cpp,
rulesets/Py_Object.h, rulesets/Py_Operation.cpp,
rulesets/Py_Operation.h, rulesets/Py_Oplist.cpp,
rulesets/Py_Oplist.h, rulesets/Py_Optime.cpp, rulesets/Py_Optime.h,
rulesets/Py_Quaternion.cpp, rulesets/Py_Quaternion.h,
rulesets/Py_Thing.cpp, rulesets/Py_Thing.h, rulesets/Py_Vector3D.cpp,
rulesets/Py_Vector3D.h, rulesets/Py_World.cpp, rulesets/Py_World.h,
rulesets/Py_WorldTime.cpp, rulesets/Py_WorldTime.h,
rulesets/PythonMindScript.cpp, rulesets/PythonThingScript.cpp,
rulesets/Python_API.cpp:
Clean up python API code, with decent names for types,
decent error reporting, and making the more paranoid checks
only present in debug build.
* common/BaseEntity.cpp, common/BaseEntity.h, server/Account.cpp:
Remove pointless method setRefnoOp, and put it in the body as
an inline method.
* common/BaseEntity.h, common/BaseWorld.cpp, common/Setup.h,
common/Tick.h, common/operations.h, common/custom.cpp,
common/types.h, common/utility.cpp, common/utility.h,
modules/Location.h, physics/Vector3D.h, rulesets/BaseMind.cpp,
rulesets/Script.h, server/EntityFactory.h:
Clean up the dependency trees using more forward declarations.
* common/inheritance.cpp, common/inheritance.h:
Move most of the implementation into the .cpp file as its
not suited to inlining.
* rulesets/MemMap.cpp, rulesets/MemMap.h, rulesets/MemMap_methods.h:
Move contents of MemMap_methods.h into the .cpp file, as it is
not suited to inlining, and remove the file from the build.
* rulesets/Py_Vector3D.cpp, rulesets/Py_Quaternion.cpp,
rulesets/Py_BBox.cpp: Add in-place construction and
destruction for all three python types which embed C++ objects.
* rulesets/Py_BBox.cpp, rulesets/Py_Quaternion.cpp,
rulesets/Python_API.cpp, server/Restorer_impl.h:
Add some casts and tweaks so that wrappers and
database code work with wfmath structures.
* modules/Location.cpp, modules/Location.h, physics/BBox.h,
physics/Vector3D.h, rulesets/Character.cpp, rulesets/Entity.cpp,
rulesets/MemMap.cpp, rulesets/Movement.cpp, rulesets/Pedestrian.cpp,
rulesets/Py_BBox.cpp, rulesets/Py_Location.cpp,
server/Account.cpp, server/WorldRouter.cpp:
Get rid of operator bool() in vector and related classes,
so that errors are less likely to emerge in code. Make use
of Vector3D::isZero() where apropriate.
Added direct support for new format bounding boxes.
* modules/Location.cpp, modules/Location.h, physics/Vector3D.h,
rulesets/Character.cpp, rulesets/Creator.cpp, rulesets/Entity.cpp,
rulesets/Movement.cpp, rulesets/Plant.cpp, rulesets/Py_Location.cpp:
Switched over to using new format bounding boxes, and re-wrote
collision code for this format, making it clearer and more
efficient at the same time.
Al Riddoch <alriddoch@zepler.org>