mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-24 13:01:47 +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.teamdamage
|
||||
<< level.maptime
|
||||
<< i
|
||||
<< level.nextmusic;
|
||||
<< i;
|
||||
|
||||
if (SaveVersion >= 3313)
|
||||
{
|
||||
arc << level.nextmusic;
|
||||
}
|
||||
|
||||
// Hub transitions must keep the current total time
|
||||
if (!hubLoad)
|
||||
|
|
|
@ -44,6 +44,26 @@ void DLightningThinker::Serialize (FArchive &arc)
|
|||
|
||||
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 (LightningLightLevels != NULL)
|
||||
|
|
|
@ -2031,6 +2031,21 @@ void FBehavior::StaticStopMyScripts (AActor *actor)
|
|||
//==========================================================================
|
||||
|
||||
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;
|
||||
// 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 ----//
|
||||
|
||||
|
|
|
@ -230,9 +230,12 @@ void AActor::Serialize (FArchive &arc)
|
|||
<< velz
|
||||
<< tics
|
||||
<< state
|
||||
<< Damage
|
||||
<< projectileKickback
|
||||
<< flags
|
||||
<< Damage;
|
||||
if (SaveVersion >= 3227)
|
||||
{
|
||||
arc << projectileKickback;
|
||||
}
|
||||
arc << flags
|
||||
<< flags2
|
||||
<< flags3
|
||||
<< flags4
|
||||
|
@ -266,10 +269,12 @@ void AActor::Serialize (FArchive &arc)
|
|||
{
|
||||
arc << args[0];
|
||||
}
|
||||
arc << args[1] << args[2] << args[3] << args[4]
|
||||
<< accuracy
|
||||
<< stamina
|
||||
<< goal
|
||||
arc << args[1] << args[2] << args[3] << args[4];
|
||||
if (SaveVersion >= 3427)
|
||||
{
|
||||
arc << accuracy << stamina;
|
||||
}
|
||||
arc << goal
|
||||
<< waterlevel
|
||||
<< MinMissileChance
|
||||
<< SpawnFlags
|
||||
|
@ -304,10 +309,14 @@ void AActor::Serialize (FArchive &arc)
|
|||
<< maxtargetrange
|
||||
<< meleethreshold
|
||||
<< meleerange
|
||||
<< DamageType
|
||||
<< DamageType;
|
||||
if (SaveVersion >= 3237)
|
||||
{
|
||||
arc
|
||||
<< PainType
|
||||
<< DeathType
|
||||
<< gravity
|
||||
<< DeathType;
|
||||
}
|
||||
arc << gravity
|
||||
<< FastChaseStrafeCount
|
||||
<< master
|
||||
<< smokecounter
|
||||
|
@ -316,16 +325,22 @@ void AActor::Serialize (FArchive &arc)
|
|||
<< VisibleToTeam // [BB]
|
||||
<< pushfactor
|
||||
<< Species
|
||||
<< Score
|
||||
<< DesignatedTeam
|
||||
<< lastpush << lastbump
|
||||
<< Score;
|
||||
if (SaveVersion >= 3113)
|
||||
{
|
||||
arc << DesignatedTeam;
|
||||
}
|
||||
arc << lastpush << lastbump
|
||||
<< PainThreshold
|
||||
<< DamageFactor
|
||||
<< WeaveIndexXY << WeaveIndexZ
|
||||
<< PoisonDamageReceived << PoisonDurationReceived << PoisonPeriodReceived << Poisoner
|
||||
<< PoisonDamage << PoisonDuration << PoisonPeriod
|
||||
<< PoisonDamageType << PoisonDamageTypeReceived
|
||||
<< ConversationRoot << Conversation;
|
||||
<< PoisonDamage << PoisonDuration << PoisonPeriod;
|
||||
if (SaveVersion >= 3235)
|
||||
{
|
||||
arc << PoisonDamageType << PoisonDamageTypeReceived;
|
||||
}
|
||||
arc << ConversationRoot << Conversation;
|
||||
|
||||
{
|
||||
FString tagstr;
|
||||
|
|
|
@ -326,9 +326,18 @@ void P_SerializeWorld (FArchive &arc)
|
|||
for (i = 0, sec = sectors; i < numsectors; i++, sec++)
|
||||
{
|
||||
arc << sec->floorplane
|
||||
<< sec->ceilingplane
|
||||
<< sec->lightlevel
|
||||
<< sec->special
|
||||
<< sec->ceilingplane;
|
||||
if (SaveVersion < 3223)
|
||||
{
|
||||
BYTE bytelight;
|
||||
arc << bytelight;
|
||||
sec->lightlevel = bytelight;
|
||||
}
|
||||
else
|
||||
{
|
||||
arc << sec->lightlevel;
|
||||
}
|
||||
arc << sec->special
|
||||
<< sec->tag
|
||||
<< sec->soundtraversed
|
||||
<< sec->seqType
|
||||
|
|
|
@ -727,7 +727,17 @@ IMPLEMENT_CLASS (DLightTransfer)
|
|||
void DLightTransfer::Serialize (FArchive &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)
|
||||
|
@ -810,7 +820,17 @@ IMPLEMENT_CLASS (DWallLightTransfer)
|
|||
void DWallLightTransfer::Serialize (FArchive &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)
|
||||
|
|
|
@ -2613,8 +2613,18 @@ void player_t::Serialize (FArchive &arc)
|
|||
<< BlendR
|
||||
<< BlendG
|
||||
<< BlendB
|
||||
<< BlendA
|
||||
<< LogText
|
||||
<< BlendA;
|
||||
if (SaveVersion < 3427)
|
||||
{
|
||||
WORD oldaccuracy, oldstamina;
|
||||
arc << oldaccuracy << oldstamina;
|
||||
if (mo != NULL)
|
||||
{
|
||||
mo->accuracy = oldaccuracy;
|
||||
mo->stamina = oldstamina;
|
||||
}
|
||||
}
|
||||
arc << LogText
|
||||
<< ConversationNPC
|
||||
<< ConversationPC
|
||||
<< ConversationNPCAngle
|
||||
|
|
|
@ -75,7 +75,7 @@
|
|||
// SAVESIG should match SAVEVER.
|
||||
|
||||
// MINSAVEVER is the minimum level snapshot version that can be loaded.
|
||||
#define MINSAVEVER 3427
|
||||
#define MINSAVEVER 3100
|
||||
|
||||
#if SVN_REVISION_NUMBER < MINSAVEVER
|
||||
// If we don't know the current revision write something very high to ensure that
|
||||
|
|
Loading…
Reference in a new issue