Page MenuHomeWildfire Games

Let StartingCamera react upon change in number of players
ClosedPublic

Authored by bb on Feb 20 2022, 2:36 PM.

Details

Summary

The StartingCamera class stores for every player its starting camera. As of rP26393 these can be loaded from the matchsettings.jsons. However the array size was not changing when the number of players changes. Which leads to errors when doing the following:

  • Start a random map with some players (from the gamesetup gui).
  • Quit the game
  • Go in gamesetup and lower the number of players
  • Start game

In current svn the matchsettings.json gets some empty objects in the playerData leading to undefined entries.

Instead we should listen to changing number of players.

Reported by marder.

Test Plan

Execute the reproduce above

Diff Detail

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

Event Timeline

bb created this revision.Feb 20 2022, 2:36 PM
bb retitled this revision from Let StartingCamera react upon chnage in number of players to Let StartingCamera react upon change in number of players.

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

Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/6789/display/redirect

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

Link to build: https://jenkins.wildfiregames.com/job/macos-differential/5697/display/redirect

marder published this revision for review.Feb 20 2022, 3:06 PM
marder accepted this revision.

Fixes the error.
Code looks good, but my knowledge of the mapsettings is limited, so can't guarantee it perfect.

This revision is now accepted and ready to land.Feb 20 2022, 3:07 PM
nwtour added a subscriber: nwtour.Feb 21 2022, 2:02 AM
In D4498#192151, @Stan wrote:

Thanks. This diff solves the problem

Freagarach updated the Trac tickets for this revision.Feb 21 2022, 7:52 AM
This revision was landed with ongoing or failed builds.Feb 22 2022, 5:35 PM
This revision was automatically updated to reflect the committed changes.
Owners added a subscriber: Restricted Owners Package.Feb 22 2022, 5:35 PM