mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-05 16:33:31 +00:00

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.