Skip to content

Commit

Permalink
Engine: updated CharacterSvgVersion, for compatibility with v362
Browse files Browse the repository at this point in the history
  • Loading branch information
ivan-mogilko committed Dec 29, 2024
1 parent a6369ff commit 9707f50
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
1 change: 1 addition & 0 deletions Common/ac/characterinfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ enum CharacterSvgVersion
kCharSvgVersion_400 = 4000000, // extended graphic effects (blend, rotate,...)
kCharSvgVersion_400_03 = 4000003, // compat with kCharSvgVersion_36115
kCharSvgVersion_400_09 = 4000009, // 32-bit color properties
kCharSvgVersion_400_13 = 4000013, // compat with kCharSvgVersion_36205
};


Expand Down
2 changes: 1 addition & 1 deletion Engine/ac/characterextras.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ void CharacterExtras::ReadFromSavegame(Stream *in, CharacterSvgVersion save_ver)
in->ReadInt8(); // reserved to fill int32
in->ReadInt8();
}
if (save_ver >= kCharSvgVersion_36205)
if (save_ver >= kCharSvgVersion_36205 && (save_ver < kCharSvgVersion_400 || save_ver >= kCharSvgVersion_400_13))
{
following = in->ReadInt32();
follow_dist = in->ReadInt32();
Expand Down
7 changes: 1 addition & 6 deletions Engine/game/savegame_components.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -598,11 +598,6 @@ HSaveError ReadCharacters(Stream *in, int32_t cmp_ver, soff_t cmp_size, const Pr
auto &chex = charextra[i];
chi.ReadFromSavegame(in, static_cast<CharacterSvgVersion>(cmp_ver));
chex.ReadFromSavegame(in, static_cast<CharacterSvgVersion>(cmp_ver));
// re-assign legacy following params (for old saves)
if (cmp_ver < kCharSvgVersion_36205)
{ // FIXME!!
//charextra[i].SetFollowing(&chi, chi.legacy_following, chi.get_follow_distance(), chi.get_follow_eagerness(), chi.get_follow_sort_behind());
}
Properties::ReadValues(play.charProps[i], in);
}
return err;
Expand Down Expand Up @@ -1725,7 +1720,7 @@ ComponentHandler ComponentHandlers[] =
},
{
"Characters",
kCharSvgVersion_400_09,
kCharSvgVersion_400_13,
kCharSvgVersion_400,
kSaveCmp_Characters,
WriteCharacters,
Expand Down

0 comments on commit 9707f50

Please sign in to comment.