Turns out I mistook @celticminstrel's opinion that we should use include guards over pragma (737916e).
Since all major compilers support `#pragma once`, there's no reason not to use it.
For future mergability reasons, this excludes src/spirit_po and src/xBRZ. It also excludes src/boost-patched.
This constitutes drop-in replacements for:
* boost::shared_ptr
* boost::scoped_ptr
* boost::weak_ptr
* boost::enable_shared_from_this
* boost::static_pointer_cast
* boost::dynamic_pointer_cast
This excludes boost::intrusive_ptr, except for stray includes. Refactoring that is more complicated.
The move_spectator_ held by move_result will never get out of scope while CAs which hold move_result(for example, get_healing, move_leader_to_keep) are alive. Rescope move_spectator to do_execute() so the move action will not depend on what move_unit_spectator does internally.
This commit created using sed, in directory src/:
$ find . -type f -exec sed -i 's/UnitPtr/unit_ptr/g' {} +
$ find . -type f -exec sed -i 's/UnitConstPtr/unit_const_ptr/g' {} +
and inspecting the results.
This enables the execution of Lua commands from within the AI. The
commands are synced to be in the replay file as well, using a new
[command][lua_ai] tag.
Function call: ai.synced_command(command, x1, y1), where command is a
string containing the lua code and x1,y1 is an optional map location
that is the only allowed external variable used in the code string.
As part of a GSoC proposal I added a new aspect so a scenario editor can control advancements in two ways:
1. Define a aspect with a string-value like "Swordsman, Knight", so the units of interesst will always advance to this
2. Use the LUA-Engine and return a function of the form advance(x, y) which will itself return a string-value
like "Swordsman, Knight". Everytime a ai-unit advances advance(x, y) will be called.
The corresponding wikipage (http://wiki.wesnoth.org/AiWML) is going to be updated soon.
1) Use check_recall/recruit_location() instead of the AI-specific
checks in do_check_before().
2) Get rid of the redundant checks in do_execute().
An advantage of #1 is that the AI better supports sides with multiple
leaders, along with leader-specific recruit lists and recall filters
(not full support, but better support).
This is to avoid potential name clashes with any classses named
"action", like what shadowm found in the test suite. (The quick fix of
2012-12-31T05:35:28Z!jt_coding@verizon.net is now reverted in favor of this fix.) One complication
is that there is already an "ai:actions" namespace, so within the "ai"
namespace, the renamed namespace is qualified as "::actions".
...to lua api via an optional boolean parameter -
ai.move_full(from,to_x,to_y,true) - this allows to steal units in
custom moveto events without the AI complaining that something is
wrong
...fix a bug with 'ai turn' event being called at the wrong time;
definitly fixes bug #14157 and bug #14161, and might fix bug #14167
(this one might had been fixed earlier); might cause the AI to stop
its turns prematurely - report this, if it happens