Always use the "slow path", because it stores and unstores the unit, triggering
the desired side effects of unstoring a unit.
Fixes issue #5133, and tests that with the new unit test.
Fixes bug #4978, that changing the facing wasn't updating the display.
This corresponds to 1.16's commit 13c5d8a96e,
that commit merely disabled the fast path to be a minimal change.
This reverts commit 51d6402453.
After discussion with @gfgtdf it was determined that this is not a useful feature after all, since it was in fact the default behaviour for the optimized path.
Also backtracked the removal of wesnoth.get_recall_units, which is now available as wesnoth.units.find_on_recall - it's just more convenient than passing x=recall to wesnoth.units.find
now modify_unit no longer causes the full rebuild of the unit unless it
is really needed, this is not only faster, it also prepares a future
optimisation in reducing the units size in savegame files.
When specified, replace rather than merge the [unit] sub-tags. Does not effect [object], [trait], [effect] or [advancement].
For example:
[modify_unit]
[filter]
id=Deoran
[/filter]
mode=replace
[filter_recall]
[not]
id="Sir Gerrick"
[/not]
[/filter_recall]
[/modify_unit]
will replace the current contents of [filter_recall] with the given contents. Without mode=replace, the contents would be appended to the previous contents.
This means [object], [advancement], and [trait] tags within [modify_unit]
can now use delayed_variable_substitution=yes.
This is currently needed for adding teleport, backstab, and leadership abilities.