There is an issue in A26 gamesetup, where selecting Regicide + Hero Garrison fails in gamesetup.
The problem is that the VictoryConditions.js gamesetting sends multiple updates to active and disabled, instead of just one single update at the end. Thus regicide is first disabled, thus HeroGarrison is deactivated, and then tries to be reactivated from the init attributes, and then disabled again later.
There are multiple fixes in theory:
- Fixing RegicideGarrison to remember the 'indented' setting and compute enabled dynamically based on that.
- Triggering Observable hooks later (using e.g. promises) and deduplicating events so that only the latest version gets sent (probably a good idea but needs more work).
- FixingVictoryConditions to send 'complete' updates. This fixes potential similar bugs elsewhere, and improves performance (negligible).
This diff implements the latter.