Page MenuHomeWildfire Games

Fix victory conditions loading (fixes Hero Garrison in regicide crashloop).

Authored by wraitii on Oct 2 2022, 12:38 PM.



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.

Test Plan

Open single player, tick regicide, tick Hero Garrison, go back, re-open GameSetup, notice that it no longer fails.

Diff Detail

rP 0 A.D. Public Repository
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

wraitii created this revision.Oct 2 2022, 12:38 PM

Successful build - Chance fights ever on the side of the prudent.

Link to build:

Build failure - The Moirai have given mortals hearts that can endure.

Link to build:

wraitii published this revision for review.Oct 2 2022, 1:14 PM
This revision was not accepted when it landed; it landed in state Needs Review.Oct 8 2022, 2:46 PM
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.