- get rid of redundant functionality
- make the unit_type_data interface more easily accessible
- reduce the public interface of unit_type_data
- rename unit_type_factory to unit_type_map_wrapper
- add a whole lot of "const"
I silenced a gcc 4.3 warning by adding parens around a shift. Based on what
I see in the code it looks like the parens really were needed and that
previously it was doing the wrong thing.
Tommy fixed two bugs in the Python AI: There was a possible crash if
Python AIs would somehow try to attack non-existing units (or attack
with a non existing unit?), and unit.name used the C++ ::name() method
but ::underlying_description() (the patch had ::description() but this
seems the right one) is the WML description tag which should be
returned according to documentation.
which adds a function raise_user_interact to the Python AI, which can
fix Python AIs with a very long thinking period getting unresponsive,
and a function test_move, which adds the possibility to 'test' the
move of a unit without actually performing it.
...in a manner consistant with other trait definititions. Get rid of
not_living key from race. Still need to put back a way for AI to tell
if a unit_type is going to be not_living.
* Wesnoth is distributed under the terms of the GPL version 2, made
that more explicit
* updated the copyright range to 2007
* updated Dave's email adress
...instead of the internal stderr, so errors can be seen under
Windows. And fixed a problem where game_config::path can be empty
under Windows, causing AIs to not work at all.
- Using safe.py from the given SVN repository, which is much cleaner,
no more notes or tests.
- Added a preprocessor, as a way to allow a limited import again.
- Made runtime docs work again, with a --python-api switch instead of
the previous AI hack.
For script authors this means:
- no more exceptions (try..except)
- no more unsafe builtins (eval, file, type, ...)
- no more import (some whitelisted modules are auto-imported currently)
- no more access to internals (e.g. __dict__, __name__, ...)
The campaign server for now still doesn't allow .py scripts, but
likely this restriction can be removed.
downloaded from the campaign server:
- Only files ending in ".py" can be executed as Python AI.
- The campaign server will rename all *.py files to *.py.unchecked
before sending.
- This means, Python files are not executed anymore without manually
removing the .unchecked.
- If a campaign has a python="allowed" property on the CS, the
renaming is not done (so someone with direct CS access could already
mark trusted campaigns - a better interface might be needed though).