mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-10 23:02:08 +00:00
- Restored savegame compatibility that was removed in r3427.
SVN r3435 (trunk)
This commit is contained in:
parent
c05345668c
commit
58f7e72d1b
8 changed files with 128 additions and 34 deletions
|
@ -1367,8 +1367,12 @@ void G_SerializeLevel (FArchive &arc, bool hubLoad)
|
||||||
<< level.aircontrol
|
<< level.aircontrol
|
||||||
<< level.teamdamage
|
<< level.teamdamage
|
||||||
<< level.maptime
|
<< level.maptime
|
||||||
<< i
|
<< i;
|
||||||
<< level.nextmusic;
|
|
||||||
|
if (SaveVersion >= 3313)
|
||||||
|
{
|
||||||
|
arc << level.nextmusic;
|
||||||
|
}
|
||||||
|
|
||||||
// Hub transitions must keep the current total time
|
// Hub transitions must keep the current total time
|
||||||
if (!hubLoad)
|
if (!hubLoad)
|
||||||
|
|
|
@ -44,6 +44,26 @@ void DLightningThinker::Serialize (FArchive &arc)
|
||||||
|
|
||||||
arc << Stopped << NextLightningFlash << LightningFlashCount;
|
arc << Stopped << NextLightningFlash << LightningFlashCount;
|
||||||
|
|
||||||
|
if (SaveVersion < 3243)
|
||||||
|
{
|
||||||
|
// Do nothing with old savegames and just keep whatever the constructor made
|
||||||
|
// but read the obsolete data from the savegame
|
||||||
|
for (i = (numsectors + (numsectors+7)/8); i > 0; --i)
|
||||||
|
{
|
||||||
|
if (SaveVersion < 3223)
|
||||||
|
{
|
||||||
|
BYTE bytelight;
|
||||||
|
arc << bytelight;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
short shortlight;
|
||||||
|
arc << shortlight;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (arc.IsLoading ())
|
if (arc.IsLoading ())
|
||||||
{
|
{
|
||||||
if (LightningLightLevels != NULL)
|
if (LightningLightLevels != NULL)
|
||||||
|
|
|
@ -2031,6 +2031,21 @@ void FBehavior::StaticStopMyScripts (AActor *actor)
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
|
|
||||||
void P_SerializeACSScriptNumber(FArchive &arc, int &scriptnum, bool was2byte)
|
void P_SerializeACSScriptNumber(FArchive &arc, int &scriptnum, bool was2byte)
|
||||||
|
{
|
||||||
|
if (SaveVersion < 3359)
|
||||||
|
{
|
||||||
|
if (was2byte)
|
||||||
|
{
|
||||||
|
WORD oldver;
|
||||||
|
arc << oldver;
|
||||||
|
scriptnum = oldver;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
arc << scriptnum;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
arc << scriptnum;
|
arc << scriptnum;
|
||||||
// If the script number is negative, then it's really a name.
|
// If the script number is negative, then it's really a name.
|
||||||
|
@ -2048,6 +2063,7 @@ void P_SerializeACSScriptNumber(FArchive &arc, int &scriptnum, bool was2byte)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//---- The ACS Interpreter ----//
|
//---- The ACS Interpreter ----//
|
||||||
|
|
||||||
|
|
|
@ -230,9 +230,12 @@ void AActor::Serialize (FArchive &arc)
|
||||||
<< velz
|
<< velz
|
||||||
<< tics
|
<< tics
|
||||||
<< state
|
<< state
|
||||||
<< Damage
|
<< Damage;
|
||||||
<< projectileKickback
|
if (SaveVersion >= 3227)
|
||||||
<< flags
|
{
|
||||||
|
arc << projectileKickback;
|
||||||
|
}
|
||||||
|
arc << flags
|
||||||
<< flags2
|
<< flags2
|
||||||
<< flags3
|
<< flags3
|
||||||
<< flags4
|
<< flags4
|
||||||
|
@ -266,10 +269,12 @@ void AActor::Serialize (FArchive &arc)
|
||||||
{
|
{
|
||||||
arc << args[0];
|
arc << args[0];
|
||||||
}
|
}
|
||||||
arc << args[1] << args[2] << args[3] << args[4]
|
arc << args[1] << args[2] << args[3] << args[4];
|
||||||
<< accuracy
|
if (SaveVersion >= 3427)
|
||||||
<< stamina
|
{
|
||||||
<< goal
|
arc << accuracy << stamina;
|
||||||
|
}
|
||||||
|
arc << goal
|
||||||
<< waterlevel
|
<< waterlevel
|
||||||
<< MinMissileChance
|
<< MinMissileChance
|
||||||
<< SpawnFlags
|
<< SpawnFlags
|
||||||
|
@ -304,10 +309,14 @@ void AActor::Serialize (FArchive &arc)
|
||||||
<< maxtargetrange
|
<< maxtargetrange
|
||||||
<< meleethreshold
|
<< meleethreshold
|
||||||
<< meleerange
|
<< meleerange
|
||||||
<< DamageType
|
<< DamageType;
|
||||||
|
if (SaveVersion >= 3237)
|
||||||
|
{
|
||||||
|
arc
|
||||||
<< PainType
|
<< PainType
|
||||||
<< DeathType
|
<< DeathType;
|
||||||
<< gravity
|
}
|
||||||
|
arc << gravity
|
||||||
<< FastChaseStrafeCount
|
<< FastChaseStrafeCount
|
||||||
<< master
|
<< master
|
||||||
<< smokecounter
|
<< smokecounter
|
||||||
|
@ -316,16 +325,22 @@ void AActor::Serialize (FArchive &arc)
|
||||||
<< VisibleToTeam // [BB]
|
<< VisibleToTeam // [BB]
|
||||||
<< pushfactor
|
<< pushfactor
|
||||||
<< Species
|
<< Species
|
||||||
<< Score
|
<< Score;
|
||||||
<< DesignatedTeam
|
if (SaveVersion >= 3113)
|
||||||
<< lastpush << lastbump
|
{
|
||||||
|
arc << DesignatedTeam;
|
||||||
|
}
|
||||||
|
arc << lastpush << lastbump
|
||||||
<< PainThreshold
|
<< PainThreshold
|
||||||
<< DamageFactor
|
<< DamageFactor
|
||||||
<< WeaveIndexXY << WeaveIndexZ
|
<< WeaveIndexXY << WeaveIndexZ
|
||||||
<< PoisonDamageReceived << PoisonDurationReceived << PoisonPeriodReceived << Poisoner
|
<< PoisonDamageReceived << PoisonDurationReceived << PoisonPeriodReceived << Poisoner
|
||||||
<< PoisonDamage << PoisonDuration << PoisonPeriod
|
<< PoisonDamage << PoisonDuration << PoisonPeriod;
|
||||||
<< PoisonDamageType << PoisonDamageTypeReceived
|
if (SaveVersion >= 3235)
|
||||||
<< ConversationRoot << Conversation;
|
{
|
||||||
|
arc << PoisonDamageType << PoisonDamageTypeReceived;
|
||||||
|
}
|
||||||
|
arc << ConversationRoot << Conversation;
|
||||||
|
|
||||||
{
|
{
|
||||||
FString tagstr;
|
FString tagstr;
|
||||||
|
|
|
@ -326,9 +326,18 @@ void P_SerializeWorld (FArchive &arc)
|
||||||
for (i = 0, sec = sectors; i < numsectors; i++, sec++)
|
for (i = 0, sec = sectors; i < numsectors; i++, sec++)
|
||||||
{
|
{
|
||||||
arc << sec->floorplane
|
arc << sec->floorplane
|
||||||
<< sec->ceilingplane
|
<< sec->ceilingplane;
|
||||||
<< sec->lightlevel
|
if (SaveVersion < 3223)
|
||||||
<< sec->special
|
{
|
||||||
|
BYTE bytelight;
|
||||||
|
arc << bytelight;
|
||||||
|
sec->lightlevel = bytelight;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
arc << sec->lightlevel;
|
||||||
|
}
|
||||||
|
arc << sec->special
|
||||||
<< sec->tag
|
<< sec->tag
|
||||||
<< sec->soundtraversed
|
<< sec->soundtraversed
|
||||||
<< sec->seqType
|
<< sec->seqType
|
||||||
|
|
|
@ -727,7 +727,17 @@ IMPLEMENT_CLASS (DLightTransfer)
|
||||||
void DLightTransfer::Serialize (FArchive &arc)
|
void DLightTransfer::Serialize (FArchive &arc)
|
||||||
{
|
{
|
||||||
Super::Serialize (arc);
|
Super::Serialize (arc);
|
||||||
arc << LastLight << Source << TargetTag << CopyFloor;
|
if (SaveVersion < 3223)
|
||||||
|
{
|
||||||
|
BYTE bytelight;
|
||||||
|
arc << bytelight;
|
||||||
|
LastLight = bytelight;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
arc << LastLight;
|
||||||
|
}
|
||||||
|
arc << Source << TargetTag << CopyFloor;
|
||||||
}
|
}
|
||||||
|
|
||||||
DLightTransfer::DLightTransfer (sector_t *srcSec, int target, bool copyFloor)
|
DLightTransfer::DLightTransfer (sector_t *srcSec, int target, bool copyFloor)
|
||||||
|
@ -810,7 +820,17 @@ IMPLEMENT_CLASS (DWallLightTransfer)
|
||||||
void DWallLightTransfer::Serialize (FArchive &arc)
|
void DWallLightTransfer::Serialize (FArchive &arc)
|
||||||
{
|
{
|
||||||
Super::Serialize (arc);
|
Super::Serialize (arc);
|
||||||
arc << LastLight << Source << TargetID << Flags;
|
if (SaveVersion < 3223)
|
||||||
|
{
|
||||||
|
BYTE bytelight;
|
||||||
|
arc << bytelight;
|
||||||
|
LastLight = bytelight;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
arc << LastLight;
|
||||||
|
}
|
||||||
|
arc << Source << TargetID << Flags;
|
||||||
}
|
}
|
||||||
|
|
||||||
DWallLightTransfer::DWallLightTransfer (sector_t *srcSec, int target, BYTE flags)
|
DWallLightTransfer::DWallLightTransfer (sector_t *srcSec, int target, BYTE flags)
|
||||||
|
|
|
@ -2613,8 +2613,18 @@ void player_t::Serialize (FArchive &arc)
|
||||||
<< BlendR
|
<< BlendR
|
||||||
<< BlendG
|
<< BlendG
|
||||||
<< BlendB
|
<< BlendB
|
||||||
<< BlendA
|
<< BlendA;
|
||||||
<< LogText
|
if (SaveVersion < 3427)
|
||||||
|
{
|
||||||
|
WORD oldaccuracy, oldstamina;
|
||||||
|
arc << oldaccuracy << oldstamina;
|
||||||
|
if (mo != NULL)
|
||||||
|
{
|
||||||
|
mo->accuracy = oldaccuracy;
|
||||||
|
mo->stamina = oldstamina;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
arc << LogText
|
||||||
<< ConversationNPC
|
<< ConversationNPC
|
||||||
<< ConversationPC
|
<< ConversationPC
|
||||||
<< ConversationNPCAngle
|
<< ConversationNPCAngle
|
||||||
|
|
|
@ -75,7 +75,7 @@
|
||||||
// SAVESIG should match SAVEVER.
|
// SAVESIG should match SAVEVER.
|
||||||
|
|
||||||
// MINSAVEVER is the minimum level snapshot version that can be loaded.
|
// MINSAVEVER is the minimum level snapshot version that can be loaded.
|
||||||
#define MINSAVEVER 3427
|
#define MINSAVEVER 3100
|
||||||
|
|
||||||
#if SVN_REVISION_NUMBER < MINSAVEVER
|
#if SVN_REVISION_NUMBER < MINSAVEVER
|
||||||
// If we don't know the current revision write something very high to ensure that
|
// If we don't know the current revision write something very high to ensure that
|
||||||
|
|
Loading…
Reference in a new issue