Validate player sync
This commit is contained in:
parent
ee23f41e0c
commit
a56452eec3
7 changed files with 73 additions and 32 deletions
|
|
@ -300,15 +300,15 @@ bool pfile_ui_set_hero_infos(bool (*uiAddHeroInfo)(_uiheroinfo *))
|
|||
pkplr.bIsHellfire = gbIsHellfireSaveGame ? 1 : 0;
|
||||
|
||||
auto &player = Players[0];
|
||||
UnPackPlayer(&pkplr, player, false);
|
||||
|
||||
CloseArchive(&archive);
|
||||
LoadHeroItems(player);
|
||||
RemoveEmptyInventory(player);
|
||||
CalcPlrInv(player, false);
|
||||
if (UnPackPlayer(&pkplr, player, false)) {
|
||||
LoadHeroItems(player);
|
||||
RemoveEmptyInventory(player);
|
||||
CalcPlrInv(player, false);
|
||||
|
||||
Game2UiPlayer(player, &uihero, hasSaveGame);
|
||||
uiAddHeroInfo(&uihero);
|
||||
Game2UiPlayer(player, &uihero, hasSaveGame);
|
||||
uiAddHeroInfo(&uihero);
|
||||
}
|
||||
}
|
||||
CloseArchive(&archive);
|
||||
}
|
||||
|
|
@ -392,7 +392,9 @@ void pfile_read_player_from_save(uint32_t saveNum, Player &player)
|
|||
|
||||
CloseArchive(&archive);
|
||||
|
||||
UnPackPlayer(&pkplr, player, false);
|
||||
if (!UnPackPlayer(&pkplr, player, false)) {
|
||||
return;
|
||||
}
|
||||
|
||||
LoadHeroItems(player);
|
||||
RemoveEmptyInventory(player);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue