Saveload: Add corresponding upstream version to SLXI chunk

This commit is contained in:
Jonathan G Rennison
2023-03-07 18:40:53 +00:00
parent 2acc00ab13
commit 6aa8997eee
3 changed files with 27 additions and 0 deletions

View File

@@ -310,6 +310,7 @@ static void WriteSavegameInfo(const char *name)
{
extern SaveLoadVersion _sl_version;
extern std::string _sl_xv_version_label;
extern uint16 _sl_xv_upstream_version;
uint32 last_ottd_rev = 0;
byte ever_modified = 0;
bool removed_newgrfs = false;
@@ -331,6 +332,9 @@ static void WriteSavegameInfo(const char *name)
if (!_sl_xv_version_label.empty()) {
p += seprintf(p, lastof(buf), " Version label: %s\n", _sl_xv_version_label.c_str());
}
if (_sl_xv_upstream_version != SL_MIN_VERSION) {
p += seprintf(p, lastof(buf), " Upstream version: %u\n", _sl_xv_upstream_version);
}
for (size_t i = 0; i < XSLFI_SIZE; i++) {
if (_sl_xv_feature_versions[i] > 0) {
p += seprintf(p, lastof(buf), " Feature: %s = %d\n", SlXvGetFeatureName((SlXvFeatureIndex) i), _sl_xv_feature_versions[i]);