|
|
|
@ -44,11 +44,13 @@ public:
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
static char old_revision_text[GAMELOG_REVISION_LENGTH];
|
|
|
|
|
static std::string revision_test;
|
|
|
|
|
|
|
|
|
|
class SlGamelogRevision : public DefaultSaveLoadHandler<SlGamelogRevision, LoggedChange> {
|
|
|
|
|
public:
|
|
|
|
|
inline static const SaveLoad description[] = {
|
|
|
|
|
SLEG_ARR("revision.text", old_revision_text, SLE_UINT8),
|
|
|
|
|
SLEG_CONDARR("revision.text", old_revision_text, SLE_UINT8, GAMELOG_REVISION_LENGTH, SL_MIN_VERSION, SLV_STRING_GAMELOG),
|
|
|
|
|
SLEG_CONDSSTR("revision.text", revision_test, SLE_STR, SLV_STRING_GAMELOG, SL_MAX_VERSION),
|
|
|
|
|
SLE_VAR(LoggedChange, revision.newgrf, SLE_UINT32),
|
|
|
|
|
SLE_VAR(LoggedChange, revision.slver, SLE_UINT16),
|
|
|
|
|
SLE_VAR(LoggedChange, revision.modified, SLE_UINT8),
|
|
|
|
@ -65,7 +67,11 @@ public:
|
|
|
|
|
{
|
|
|
|
|
if (lc->ct != GLCT_REVISION) return;
|
|
|
|
|
SlObject(lc, this->GetLoadDescription());
|
|
|
|
|
lc->revision.text = stredup(old_revision_text, lastof(old_revision_text));
|
|
|
|
|
if (IsSavegameVersionBefore(SLV_STRING_GAMELOG)) {
|
|
|
|
|
lc->revision.text = stredup(old_revision_text, lastof(old_revision_text));
|
|
|
|
|
} else {
|
|
|
|
|
lc->revision.text = stredup(revision_test.c_str());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void LoadCheck(LoggedChange *lc) const override { this->Load(lc); }
|
|
|
|
|