This fixes a crash that was seen when the context destructor was calling
either leave or leave_global while iterating over the list. The current iterator
handle would be invalidated and further calls to it would return invalid values.
This adds a destructor to the context class to ensure that any joined
event_handlers leave the context before it is deallocated.
It also changes the preferences to explicitly leave the global event
context as it is destroyed instead of when the event handler is
destroyed during _exit().
Also replace std::list.splice with push_back and erase(iterator) in
an attempt to avoid compile errors on older versions of gcc.
Use a consistent type= list and include all advancements when selecting and Advisor.
Harper and Baldras cannot be the Advisor.
No need to search for an Advisor to recall in S03, S02 set one (or not) and it cannot have changed.
Use the new [role] features.
For each speaking part, make sure it is assigned to a unit. For parts where the conversation suffers if not delivered, recall a unit or recruit one if none are available. For parts where the missing the line does not appear to adversely effect the conversation, omit the lines if no unit can be found on the board at the time.
- add_fog removed fog and remove_fog added it
- similarly, [lift_fog] and [clear_fog] were swapped
- make sure first argument is a list of sides before trying to interpret it as one
This is meant to replace ~RIGHT() and also the newer ~LEFT(),
with one exception: ~RIGHT() will still be the standard way to
make a unit's portrait go on the right by default.
- For MAIs using aspects, make the facet ID more unique
- Only shallow-preparse the [micro_ai], rather than fully preparsing it
(This is so that filters in Micro AIs can use $this_unit if needed)
victory is an unsynced event to its potentially unsafe to change the
gamestate in it, this mostly effects LoW (which can be played as a mp
campaign) where i replaced most victory events.
But it also effects sp becasue it can casue bugs to create units in
unsynced events which are used later (here: in later scenarios), so i
replaced also all sp victory events that do that.
Note that the 'scenario_end event'+'proceed_to_next_scenario filter' has
a slightly different meaning than 'victory event': the second gets fired
when there is a local human side who won the scneario while the first
gets fired if there is any human side who on the scenario. In sp this
is the same since there are no remote human sides, but in mp this is the
reason why the first is synced and the second is not.
We could add a seperate event for this case ("before next scenario" or
similar) for easier use, but i didn't find a good name for
that yet.
- search_recall_list=yes|no (default yes)
- [else] tag which is run if no unit matches
- auto_recall=yes|no (default no) which recalls the unit if it's on the recall list