stevecotton / Non_Fatal_Wounds

An add-on for Wesnoth
GNU General Public License v2.0
1 stars 1 forks source link

Handle units with the same id at different points in a scenario #3

Open stevecotton opened 1 year ago

stevecotton commented 1 year ago

Found by @Toranks,

That is the case of UTBS S08, where the messenger knight id=messenger is always generated with the same id, although there are never two alive at the same time. It's a conflict with a mod that's the real problem, not the scenario.

Context is last night's discussion in the Discord #development / IRC #wesnoth-dev channel.

Toranks commented 1 year ago

If the idea is to prevent two units with the same id from being added to the array of wounded units, the solution is as simple as three extra lines here:

#define NFW_CATCH_LAST_BREATH
     [filter]
         [not]
             id=$nfw_exclude_unit_id
             [or]
                 find_in=nfw_wounded
             [/or]
         [/not]
     [/filter]