Skip to content

2023-July-16 - 2.6.14417

Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 16 Jul 11:55
c4f9314
Fix NPE with loaded save games from past versions. (#11783)

The issue is that old saved games may save references to the GamePlayer on various objects, including pending battles.

Since 2.6 has an invariant that all GamePlayer objects have a non-null getData(), which was not true in 2.5 and earlier, we need to update these after loading the game. In particular, we need to fix up all references to the null player with the instance from the game data.

This was already being done for units and territories via GameData::fixUpNullPlayers(). This adds it also for pending battles.