[wesnoth-commits] [wesnoth/wesnoth] b2cd1c: Handle unit overlays as modifications, allow [effe...

Steve Cotton noreply at github.com
Sat Aug 10 21:49:35 UTC 2019


  Branch: refs/heads/master
  Home:   https://github.com/wesnoth/wesnoth
  Commit: b2cd1cf6c3b3d32eac28a7e079f62c7a1cea7d2a
      https://github.com/wesnoth/wesnoth/commit/b2cd1cf6c3b3d32eac28a7e079f62c7a1cea7d2a
  Author: Steve Cotton <steve at octalot.co.uk>
  Date:   2019-08-10 (Sat, 10 Aug 2019)

  Changed paths:
    M data/lua/wml-tags.lua
    M data/schema/units/modifications.cfg
    M src/units/unit.cpp

  Log Message:
  -----------
  Handle unit overlays as modifications, allow [effect] to remove them

Possible fix for #4058, with the following logic:

* If non-empty, [unit]overlay= is handled by adding modifications
* unit::write will always output an empty overlay=
* The Lua API's get_units() will still provide the list of overlays
* [effect]apply_to=overlay can now remove as well as add overlays
* [remove_unit_overlay] is implemented with [effect]apply_to=overlay

Using [object]s with durations hasn't been tested, but expected effects:
* An expired add= followed by a non-expired remove= will simply cause the remove=
    to have no effect when std::remove(overlays_ ...) is called.
* A remove= followed by [remove_unit_overlay] cause the [remove_unit_overlay] to be a no-op,
    and the overlay will reappear when the first remove= expires. This edge case is already
	documented as unsupported on the wiki.





More information about the Commits mailing list