File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -38,7 +38,8 @@ static const uint8_t currentReplayDataVersion = 1;
3838uint8_t Replay::GetLatestMinorVersion () const
3939{
4040 // 8.1: Portraits support
41- return 1 ;
41+ // 8.2: Set correct initial distributions if replay starts without savegame for leather addon
42+ return 2 ;
4243}
4344
4445uint8_t Replay::GetLatestMajorVersion () const
Original file line number Diff line number Diff line change 1111#include " GameManager.h"
1212#include " GameMessage_GameCommand.h"
1313#include " JoinPlayerInfo.h"
14+ #include " LeatherLoader.h"
1415#include " Loader.h"
1516#include " NWFInfo.h"
1617#include " PlayerGameCommands.h"
@@ -1560,6 +1561,22 @@ bool GameClient::StartReplay(const boost::filesystem::path& path)
15601561 return false ;
15611562 }
15621563
1564+ if (!mapinfo.savegame && replayinfo->replay .GetMinorVersion () < 2 )
1565+ {
1566+ for (unsigned i = 0 ; i < game->world_ .GetNumPlayers (); i++)
1567+ {
1568+ auto newDistributions = default_settings.distribution ;
1569+ unsigned idx = 0 ;
1570+ for (const DistributionMapping& mapping : distributionMap)
1571+ {
1572+ if (leatheraddon::isLeatherAddonBuildingType (std::get<1 >(mapping)))
1573+ newDistributions[idx] = 0 ;
1574+ idx++;
1575+ }
1576+ game->world_ .GetPlayer (i).ChangeDistribution (newDistributions);
1577+ }
1578+ }
1579+
15631580 replayinfo->next_gf = replayinfo->replay .ReadGF ();
15641581
15651582 return true ;
You can’t perform that action at this time.
0 commit comments