mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-28 06:53:58 +00:00
- removed all savegame compatibility handling, since the data is just too different from what it was before to try to convert it.
This commit is contained in:
parent
4e5ba49aca
commit
3ee42f6aa6
15 changed files with 153 additions and 607 deletions
|
@ -1929,13 +1929,6 @@ void G_DoLoadGame ()
|
|||
BYTE *vars_p = (BYTE *)text;
|
||||
C_ReadCVars (&vars_p);
|
||||
delete[] text;
|
||||
if (SaveVersion <= 4509)
|
||||
{
|
||||
// account for the flag shuffling for making freelook a 3-state option
|
||||
INTBOOL flag = dmflags & DF_YES_FREELOOK;
|
||||
dmflags = dmflags & ~DF_YES_FREELOOK;
|
||||
if (flag) dmflags2 = dmflags2 | DF2_RESPAWN_SUPER;
|
||||
}
|
||||
}
|
||||
|
||||
// dearchive all the modifications
|
||||
|
|
|
@ -1493,26 +1493,11 @@ void G_SerializeLevel (FArchive &arc, bool hubLoad)
|
|||
<< level.maptime
|
||||
<< i;
|
||||
|
||||
if (SaveVersion >= 3313)
|
||||
{
|
||||
// This is a player property now
|
||||
int nextmusic;
|
||||
arc << nextmusic;
|
||||
}
|
||||
|
||||
// Hub transitions must keep the current total time
|
||||
if (!hubLoad)
|
||||
level.totaltime = i;
|
||||
|
||||
if (SaveVersion >= 4507)
|
||||
{
|
||||
arc << level.skytexture1 << level.skytexture2;
|
||||
}
|
||||
else
|
||||
{
|
||||
level.skytexture1 = TexMan.GetTexture(arc.ReadName(), FTexture::TEX_Wall, FTextureManager::TEXMAN_Overridable | FTextureManager::TEXMAN_ReturnFirst);
|
||||
level.skytexture2 = TexMan.GetTexture(arc.ReadName(), FTexture::TEX_Wall, FTextureManager::TEXMAN_Overridable | FTextureManager::TEXMAN_ReturnFirst);
|
||||
}
|
||||
arc << level.skytexture1 << level.skytexture2;
|
||||
if (arc.IsLoading())
|
||||
{
|
||||
sky1texture = level.skytexture1;
|
||||
|
@ -1553,12 +1538,7 @@ void G_SerializeLevel (FArchive &arc, bool hubLoad)
|
|||
P_SerializeSubsectors(arc);
|
||||
StatusBar->Serialize (arc);
|
||||
|
||||
if (SaveVersion >= 4222)
|
||||
{ // This must be done *after* thinkers are serialized.
|
||||
arc << level.DefaultSkybox;
|
||||
}
|
||||
|
||||
arc << level.total_monsters << level.total_items << level.total_secrets;
|
||||
arc << level.DefaultSkybox << level.total_monsters << level.total_items << level.total_secrets;
|
||||
|
||||
// Does this level have custom translations?
|
||||
FRemapTable *trans;
|
||||
|
@ -1788,8 +1768,6 @@ void G_WriteSnapshots (FILE *file)
|
|||
void G_ReadSnapshots (PNGHandle *png)
|
||||
{
|
||||
DWORD chunkLen;
|
||||
BYTE namelen;
|
||||
char mapname[256];
|
||||
FString MapName;
|
||||
level_info_t *i;
|
||||
|
||||
|
@ -1802,14 +1780,7 @@ void G_ReadSnapshots (PNGHandle *png)
|
|||
DWORD snapver;
|
||||
|
||||
arc << snapver;
|
||||
if (SaveVersion < 4508)
|
||||
{
|
||||
arc << namelen;
|
||||
arc.Read(mapname, namelen);
|
||||
mapname[namelen] = 0;
|
||||
MapName = mapname;
|
||||
}
|
||||
else arc << MapName;
|
||||
arc << MapName;
|
||||
i = FindLevelInfo (MapName);
|
||||
i->snapshotVer = snapver;
|
||||
i->snapshot = new FCompressedMemFile;
|
||||
|
@ -1824,14 +1795,7 @@ void G_ReadSnapshots (PNGHandle *png)
|
|||
DWORD snapver;
|
||||
|
||||
arc << snapver;
|
||||
if (SaveVersion < 4508)
|
||||
{
|
||||
arc << namelen;
|
||||
arc.Read(mapname, namelen);
|
||||
mapname[namelen] = 0;
|
||||
MapName = mapname;
|
||||
}
|
||||
else arc << MapName;
|
||||
arc << MapName;
|
||||
TheDefaultLevelInfo.snapshotVer = snapver;
|
||||
TheDefaultLevelInfo.snapshot = new FCompressedMemFile;
|
||||
TheDefaultLevelInfo.snapshot->Serialize (arc);
|
||||
|
@ -1842,25 +1806,10 @@ void G_ReadSnapshots (PNGHandle *png)
|
|||
{
|
||||
FPNGChunkArchive arc (png->File->GetFile(), VIST_ID, chunkLen);
|
||||
|
||||
if (SaveVersion < 4508)
|
||||
while (arc << MapName, MapName.Len() > 0)
|
||||
{
|
||||
arc << namelen;
|
||||
while (namelen != 0)
|
||||
{
|
||||
arc.Read(mapname, namelen);
|
||||
mapname[namelen] = 0;
|
||||
i = FindLevelInfo(mapname);
|
||||
i->flags |= LEVEL_VISITED;
|
||||
arc << namelen;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
while (arc << MapName, MapName.Len() > 0)
|
||||
{
|
||||
i = FindLevelInfo(MapName);
|
||||
i->flags |= LEVEL_VISITED;
|
||||
}
|
||||
i = FindLevelInfo(MapName);
|
||||
i->flags |= LEVEL_VISITED;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1956,8 +1905,6 @@ void P_WriteACSDefereds (FILE *file)
|
|||
|
||||
void P_ReadACSDefereds (PNGHandle *png)
|
||||
{
|
||||
BYTE namelen;
|
||||
char mapname[256];
|
||||
FString MapName;
|
||||
size_t chunklen;
|
||||
|
||||
|
@ -1967,33 +1914,14 @@ void P_ReadACSDefereds (PNGHandle *png)
|
|||
{
|
||||
FPNGChunkArchive arc (png->File->GetFile(), ACSD_ID, chunklen);
|
||||
|
||||
if (SaveVersion < 4508)
|
||||
while (arc << MapName, MapName.Len() > 0)
|
||||
{
|
||||
arc << namelen;
|
||||
while (namelen != 0)
|
||||
level_info_t *i = FindLevelInfo(MapName);
|
||||
if (i == NULL)
|
||||
{
|
||||
arc.Read(mapname, namelen);
|
||||
mapname[namelen] = 0;
|
||||
level_info_t *i = FindLevelInfo(mapname);
|
||||
if (i == NULL)
|
||||
{
|
||||
I_Error("Unknown map '%s' in savegame", mapname);
|
||||
}
|
||||
arc << i->defered;
|
||||
arc << namelen;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
while (arc << MapName, MapName.Len() > 0)
|
||||
{
|
||||
level_info_t *i = FindLevelInfo(MapName);
|
||||
if (i == NULL)
|
||||
{
|
||||
I_Error("Unknown map '%s' in savegame", MapName.GetChars());
|
||||
}
|
||||
arc << i->defered;
|
||||
I_Error("Unknown map '%s' in savegame", MapName.GetChars());
|
||||
}
|
||||
arc << i->defered;
|
||||
}
|
||||
}
|
||||
png->File->ResetFilePtr();
|
||||
|
|
|
@ -24,12 +24,7 @@ IMPLEMENT_CLASS (AHexenArmor)
|
|||
void ABasicArmor::Serialize (FArchive &arc)
|
||||
{
|
||||
Super::Serialize (arc);
|
||||
arc << SavePercent << BonusCount << MaxAbsorb << MaxFullAbsorb << AbsorbCount << ArmorType;
|
||||
|
||||
if (SaveVersion >= 4511)
|
||||
{
|
||||
arc << ActualSaveAmount;
|
||||
}
|
||||
arc << SavePercent << BonusCount << MaxAbsorb << MaxFullAbsorb << AbsorbCount << ArmorType << ActualSaveAmount;
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
|
|
|
@ -1205,14 +1205,7 @@ IMPLEMENT_CLASS (APowerSpeed)
|
|||
void APowerSpeed::Serialize(FArchive &arc)
|
||||
{
|
||||
Super::Serialize (arc);
|
||||
if (SaveVersion < 4146)
|
||||
{
|
||||
SpeedFlags = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
arc << SpeedFlags;
|
||||
}
|
||||
arc << SpeedFlags;
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
|
|
|
@ -44,26 +44,6 @@ 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)
|
||||
|
|
|
@ -90,16 +90,11 @@ void AWeapon::Serialize (FArchive &arc)
|
|||
<< MoveCombatDist
|
||||
<< Ammo1 << Ammo2 << SisterWeapon << GivenAsMorphWeapon
|
||||
<< bAltFire
|
||||
<< ReloadCounter;
|
||||
if (SaveVersion >= 3615) {
|
||||
arc << BobStyle << BobSpeed << BobRangeX << BobRangeY;
|
||||
}
|
||||
arc << FOVScale
|
||||
<< Crosshair;
|
||||
if (SaveVersion >= 4203)
|
||||
{
|
||||
arc << MinSelAmmo1 << MinSelAmmo2;
|
||||
}
|
||||
<< ReloadCounter
|
||||
<< BobStyle << BobSpeed << BobRangeX << BobRangeY
|
||||
<< FOVScale
|
||||
<< Crosshair
|
||||
<< MinSelAmmo1 << MinSelAmmo2;
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
|
@ -731,10 +726,7 @@ IMPLEMENT_CLASS(AWeaponGiver)
|
|||
void AWeaponGiver::Serialize(FArchive &arc)
|
||||
{
|
||||
Super::Serialize(arc);
|
||||
if (SaveVersion >= 4246)
|
||||
{
|
||||
arc << DropAmmoFactor;
|
||||
}
|
||||
arc << DropAmmoFactor;
|
||||
}
|
||||
|
||||
bool AWeaponGiver::TryPickup(AActor *&toucher)
|
||||
|
|
|
@ -179,53 +179,23 @@ DHUDMessage::~DHUDMessage ()
|
|||
//
|
||||
//============================================================================
|
||||
|
||||
void DHUDMessage::Serialize (FArchive &arc)
|
||||
void DHUDMessage::Serialize(FArchive &arc)
|
||||
{
|
||||
Super::Serialize (arc);
|
||||
Super::Serialize(arc);
|
||||
arc << Left << Top << CenterX << HoldTics
|
||||
<< Tics << State << TextColor
|
||||
<< SBarID << SourceText << Font << Next
|
||||
<< HUDWidth << HUDHeight;
|
||||
if (SaveVersion >= 3960)
|
||||
{
|
||||
arc << NoWrap;
|
||||
arc << ClipX << ClipY << ClipWidth << ClipHeight;
|
||||
arc << WrapWidth;
|
||||
}
|
||||
else
|
||||
{
|
||||
NoWrap = false;
|
||||
ClipX = ClipY = ClipWidth = ClipHeight = WrapWidth = 0;
|
||||
}
|
||||
if (SaveVersion >= 4525)
|
||||
{
|
||||
arc << HandleAspect;
|
||||
}
|
||||
else
|
||||
{
|
||||
HandleAspect = true;
|
||||
}
|
||||
if (arc.IsLoading ())
|
||||
<< HUDWidth << HUDHeight
|
||||
<< NoWrap
|
||||
<< ClipX << ClipY << ClipWidth << ClipHeight
|
||||
<< WrapWidth
|
||||
<< HandleAspect
|
||||
<< VisibilityFlags
|
||||
<< Style << Alpha;
|
||||
if (arc.IsLoading())
|
||||
{
|
||||
Lines = NULL;
|
||||
ResetText (SourceText);
|
||||
}
|
||||
if (SaveVersion < 3821)
|
||||
{
|
||||
VisibilityFlags = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
arc << VisibilityFlags;
|
||||
}
|
||||
if (SaveVersion < 3824)
|
||||
{
|
||||
Style = STYLE_Translucent;
|
||||
Alpha = 1.;
|
||||
}
|
||||
else
|
||||
{
|
||||
arc << Style << Alpha;
|
||||
ResetText(SourceText);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1651,17 +1651,9 @@ void DBaseStatusBar::ReceivedWeapon (AWeapon *weapon)
|
|||
|
||||
void DBaseStatusBar::Serialize (FArchive &arc)
|
||||
{
|
||||
if (SaveVersion < 3821)
|
||||
for (size_t i = 0; i < countof(Messages); ++i)
|
||||
{
|
||||
memset(Messages, 0, sizeof(Messages));
|
||||
arc << Messages[HUDMSGLayer_Default];
|
||||
}
|
||||
else
|
||||
{
|
||||
for (size_t i = 0; i < countof(Messages); ++i)
|
||||
{
|
||||
arc << Messages[i];
|
||||
}
|
||||
arc << Messages[i];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
133
src/p_acs.cpp
133
src/p_acs.cpp
|
@ -1654,13 +1654,13 @@ void FBehavior::StaticSerializeModuleStates (FArchive &arc)
|
|||
if (arc.IsStoring())
|
||||
{
|
||||
arc.WriteString (module->ModuleName);
|
||||
if (SaveVersion >= 4516) arc << ModSize;
|
||||
arc << ModSize;
|
||||
}
|
||||
else
|
||||
{
|
||||
char *modname = NULL;
|
||||
arc << modname;
|
||||
if (SaveVersion >= 4516) arc << ModSize;
|
||||
arc << ModSize;
|
||||
if (stricmp (modname, module->ModuleName) != 0)
|
||||
{
|
||||
delete[] modname;
|
||||
|
@ -2899,35 +2899,19 @@ void FBehavior::StaticStopMyScripts (AActor *actor)
|
|||
|
||||
void P_SerializeACSScriptNumber(FArchive &arc, int &scriptnum, bool was2byte)
|
||||
{
|
||||
if (SaveVersion < 3359)
|
||||
arc << scriptnum;
|
||||
// If the script number is negative, then it's really a name.
|
||||
// So read/store the name after it.
|
||||
if (scriptnum < 0)
|
||||
{
|
||||
if (was2byte)
|
||||
if (arc.IsStoring())
|
||||
{
|
||||
WORD oldver;
|
||||
arc << oldver;
|
||||
scriptnum = oldver;
|
||||
arc.WriteName(FName(ENamedName(-scriptnum)).GetChars());
|
||||
}
|
||||
else
|
||||
{
|
||||
arc << scriptnum;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
arc << scriptnum;
|
||||
// If the script number is negative, then it's really a name.
|
||||
// So read/store the name after it.
|
||||
if (scriptnum < 0)
|
||||
{
|
||||
if (arc.IsStoring())
|
||||
{
|
||||
arc.WriteName(FName(ENamedName(-scriptnum)).GetChars());
|
||||
}
|
||||
else
|
||||
{
|
||||
const char *nam = arc.ReadName();
|
||||
scriptnum = -FName(nam);
|
||||
}
|
||||
const char *nam = arc.ReadName();
|
||||
scriptnum = -FName(nam);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2969,52 +2953,47 @@ void DACSThinker::Serialize (FArchive &arc)
|
|||
int scriptcount = 0;
|
||||
|
||||
Super::Serialize (arc);
|
||||
if (SaveVersion < 4515)
|
||||
arc << Scripts << LastScript;
|
||||
if (arc.IsStoring())
|
||||
{
|
||||
DLevelScript *script;
|
||||
script = Scripts;
|
||||
while (script)
|
||||
{
|
||||
scriptcount++;
|
||||
|
||||
// We want to store this list backwards, so we can't loose the last pointer
|
||||
if (script->next == NULL)
|
||||
break;
|
||||
script = script->next;
|
||||
}
|
||||
arc << scriptcount;
|
||||
|
||||
while (script)
|
||||
{
|
||||
arc << script;
|
||||
script = script->prev;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (arc.IsStoring())
|
||||
// We are running through this list backwards, so the next entry is the last processed
|
||||
DLevelScript *next = NULL;
|
||||
arc << scriptcount;
|
||||
Scripts = NULL;
|
||||
LastScript = NULL;
|
||||
for (int i = 0; i < scriptcount; i++)
|
||||
{
|
||||
DLevelScript *script;
|
||||
script = Scripts;
|
||||
while (script)
|
||||
{
|
||||
scriptcount++;
|
||||
arc << Scripts;
|
||||
|
||||
// We want to store this list backwards, so we can't loose the last pointer
|
||||
if (script->next == NULL)
|
||||
break;
|
||||
script = script->next;
|
||||
}
|
||||
arc << scriptcount;
|
||||
Scripts->next = next;
|
||||
Scripts->prev = NULL;
|
||||
if (next != NULL)
|
||||
next->prev = Scripts;
|
||||
|
||||
while (script)
|
||||
{
|
||||
arc << script;
|
||||
script = script->prev;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// We are running through this list backwards, so the next entry is the last processed
|
||||
DLevelScript *next = NULL;
|
||||
arc << scriptcount;
|
||||
Scripts = NULL;
|
||||
LastScript = NULL;
|
||||
for (int i = 0; i < scriptcount; i++)
|
||||
{
|
||||
arc << Scripts;
|
||||
next = Scripts;
|
||||
|
||||
Scripts->next = next;
|
||||
Scripts->prev = NULL;
|
||||
if (next != NULL)
|
||||
next->prev = Scripts;
|
||||
|
||||
next = Scripts;
|
||||
|
||||
if (i == 0)
|
||||
LastScript = Scripts;
|
||||
}
|
||||
if (i == 0)
|
||||
LastScript = Scripts;
|
||||
}
|
||||
}
|
||||
if (arc.IsStoring ())
|
||||
|
@ -3102,8 +3081,6 @@ void DLevelScript::Serialize (FArchive &arc)
|
|||
DWORD i;
|
||||
|
||||
Super::Serialize (arc);
|
||||
if (SaveVersion < 4515)
|
||||
arc << next << prev;
|
||||
|
||||
P_SerializeACSScriptNumber(arc, script, false);
|
||||
|
||||
|
@ -3140,23 +3117,9 @@ void DLevelScript::Serialize (FArchive &arc)
|
|||
|
||||
arc << activefont
|
||||
<< hudwidth << hudheight;
|
||||
if (SaveVersion >= 3960)
|
||||
{
|
||||
arc << ClipRectLeft << ClipRectTop << ClipRectWidth << ClipRectHeight
|
||||
<< WrapWidth;
|
||||
}
|
||||
else
|
||||
{
|
||||
ClipRectLeft = ClipRectTop = ClipRectWidth = ClipRectHeight = WrapWidth = 0;
|
||||
}
|
||||
if (SaveVersion >= 4058)
|
||||
{
|
||||
arc << InModuleScriptNumber;
|
||||
}
|
||||
else
|
||||
{ // Don't worry about locating profiling info for old saves.
|
||||
InModuleScriptNumber = -1;
|
||||
}
|
||||
arc << ClipRectLeft << ClipRectTop << ClipRectWidth << ClipRectHeight
|
||||
<< WrapWidth;
|
||||
arc << InModuleScriptNumber;
|
||||
}
|
||||
|
||||
DLevelScript::DLevelScript ()
|
||||
|
|
101
src/p_mobj.cpp
101
src/p_mobj.cpp
|
@ -275,29 +275,17 @@ void AActor::Serialize(FArchive &arc)
|
|||
arc << dmg;
|
||||
Damage = UncalcDamageValue(dmg, GetDefault()->Damage);
|
||||
}
|
||||
if (SaveVersion >= 4530)
|
||||
{
|
||||
P_SerializeTerrain(arc, floorterrain);
|
||||
}
|
||||
if (SaveVersion >= 3227)
|
||||
{
|
||||
arc << projectileKickback;
|
||||
}
|
||||
arc << flags
|
||||
P_SerializeTerrain(arc, floorterrain);
|
||||
arc << projectileKickback
|
||||
<< flags
|
||||
<< flags2
|
||||
<< flags3
|
||||
<< flags4
|
||||
<< flags5
|
||||
<< flags6;
|
||||
if (SaveVersion >= 4504)
|
||||
{
|
||||
arc << flags7;
|
||||
}
|
||||
if (SaveVersion >= 4512)
|
||||
{
|
||||
arc << weaponspecial;
|
||||
}
|
||||
arc << special1
|
||||
<< flags6
|
||||
<< flags7
|
||||
<< weaponspecial
|
||||
<< special1
|
||||
<< special2
|
||||
<< specialf1
|
||||
<< specialf2
|
||||
|
@ -313,12 +301,9 @@ void AActor::Serialize(FArchive &arc)
|
|||
<< threshold
|
||||
<< player
|
||||
<< SpawnPoint
|
||||
<< SpawnAngle;
|
||||
if (SaveVersion >= 4506)
|
||||
{
|
||||
arc << StartHealth;
|
||||
}
|
||||
arc << skillrespawncount
|
||||
<< SpawnAngle
|
||||
<< StartHealth
|
||||
<< skillrespawncount
|
||||
<< tracer
|
||||
<< Floorclip
|
||||
<< tid
|
||||
|
@ -332,21 +317,13 @@ void AActor::Serialize(FArchive &arc)
|
|||
arc << args[0];
|
||||
}
|
||||
arc << args[1] << args[2] << args[3] << args[4];
|
||||
if (SaveVersion >= 3427)
|
||||
{
|
||||
arc << accuracy << stamina;
|
||||
}
|
||||
arc << accuracy << stamina;
|
||||
arc << goal
|
||||
<< waterlevel
|
||||
<< MinMissileChance
|
||||
<< SpawnFlags
|
||||
<< Inventory
|
||||
<< InventoryID;
|
||||
if (SaveVersion < 4513)
|
||||
{
|
||||
SDWORD id;
|
||||
arc << id;
|
||||
}
|
||||
arc << FloatBobPhase
|
||||
<< Translation
|
||||
<< SeeSound
|
||||
|
@ -376,16 +353,9 @@ void AActor::Serialize(FArchive &arc)
|
|||
<< meleethreshold
|
||||
<< meleerange
|
||||
<< DamageType;
|
||||
if (SaveVersion >= 4501)
|
||||
{
|
||||
arc << DamageTypeReceived;
|
||||
}
|
||||
if (SaveVersion >= 3237)
|
||||
{
|
||||
arc
|
||||
<< PainType
|
||||
arc << DamageTypeReceived;
|
||||
arc << PainType
|
||||
<< DeathType;
|
||||
}
|
||||
arc << Gravity
|
||||
<< FastChaseStrafeCount
|
||||
<< master
|
||||
|
@ -396,48 +366,23 @@ void AActor::Serialize(FArchive &arc)
|
|||
<< pushfactor
|
||||
<< Species
|
||||
<< Score;
|
||||
if (SaveVersion >= 3113)
|
||||
{
|
||||
arc << DesignatedTeam;
|
||||
}
|
||||
arc << DesignatedTeam;
|
||||
arc << lastpush << lastbump
|
||||
<< PainThreshold
|
||||
<< DamageFactor;
|
||||
if (SaveVersion >= 4516)
|
||||
{
|
||||
arc << DamageMultiply;
|
||||
}
|
||||
else
|
||||
{
|
||||
DamageMultiply = 1.;
|
||||
}
|
||||
arc << DamageMultiply;
|
||||
arc << WeaveIndexXY << WeaveIndexZ
|
||||
<< PoisonDamageReceived << PoisonDurationReceived << PoisonPeriodReceived << Poisoner
|
||||
<< PoisonDamage << PoisonDuration << PoisonPeriod;
|
||||
if (SaveVersion >= 3235)
|
||||
{
|
||||
arc << PoisonDamageType << PoisonDamageTypeReceived;
|
||||
}
|
||||
arc << PoisonDamageType << PoisonDamageTypeReceived;
|
||||
arc << ConversationRoot << Conversation;
|
||||
if (SaveVersion >= 4509)
|
||||
{
|
||||
arc << FriendPlayer;
|
||||
}
|
||||
if (SaveVersion >= 4517)
|
||||
{
|
||||
arc << TeleFogSourceType
|
||||
<< TeleFogDestType;
|
||||
}
|
||||
if (SaveVersion >= 4518)
|
||||
{
|
||||
arc << RipperLevel
|
||||
<< RipLevelMin
|
||||
<< RipLevelMax;
|
||||
}
|
||||
if (SaveVersion >= 4533)
|
||||
{
|
||||
arc << DefThreshold;
|
||||
}
|
||||
arc << FriendPlayer;
|
||||
arc << TeleFogSourceType
|
||||
<< TeleFogDestType;
|
||||
arc << RipperLevel
|
||||
<< RipLevelMin
|
||||
<< RipLevelMax;
|
||||
arc << DefThreshold;
|
||||
|
||||
{
|
||||
FString tagstr;
|
||||
|
|
|
@ -341,22 +341,8 @@ void P_SerializeWorld (FArchive &arc)
|
|||
{
|
||||
arc << sec->floorplane
|
||||
<< sec->ceilingplane;
|
||||
if (SaveVersion < 3223)
|
||||
{
|
||||
BYTE bytelight;
|
||||
arc << bytelight;
|
||||
sec->lightlevel = bytelight;
|
||||
}
|
||||
else
|
||||
{
|
||||
arc << sec->lightlevel;
|
||||
}
|
||||
arc << sec->lightlevel;
|
||||
arc << sec->special;
|
||||
if (SaveVersion < 4523)
|
||||
{
|
||||
short tag;
|
||||
arc << tag;
|
||||
}
|
||||
arc << sec->soundtraversed
|
||||
<< sec->seqType
|
||||
<< sec->friction
|
||||
|
@ -372,49 +358,12 @@ void P_SerializeWorld (FArchive &arc)
|
|||
<< sec->heightsec
|
||||
<< sec->bottommap << sec->midmap << sec->topmap
|
||||
<< sec->gravity;
|
||||
if (SaveVersion >= 4530)
|
||||
{
|
||||
P_SerializeTerrain(arc, sec->terrainnum[0]);
|
||||
P_SerializeTerrain(arc, sec->terrainnum[1]);
|
||||
}
|
||||
if (SaveVersion >= 4529)
|
||||
{
|
||||
arc << sec->damageamount;
|
||||
}
|
||||
else
|
||||
{
|
||||
short dmg;
|
||||
arc << dmg;
|
||||
sec->damageamount = dmg;
|
||||
}
|
||||
if (SaveVersion >= 4528)
|
||||
{
|
||||
arc << sec->damageinterval
|
||||
<< sec->leakydamage
|
||||
<< sec->damagetype;
|
||||
}
|
||||
else
|
||||
{
|
||||
short damagemod;
|
||||
arc << damagemod;
|
||||
sec->damagetype = MODtoDamageType(damagemod);
|
||||
if (sec->damageamount < 20)
|
||||
{
|
||||
sec->leakydamage = 0;
|
||||
sec->damageinterval = 32;
|
||||
}
|
||||
else if (sec->damageamount < 50)
|
||||
{
|
||||
sec->leakydamage = 5;
|
||||
sec->damageinterval = 32;
|
||||
}
|
||||
else
|
||||
{
|
||||
sec->leakydamage = 256;
|
||||
sec->damageinterval = 1;
|
||||
}
|
||||
}
|
||||
|
||||
P_SerializeTerrain(arc, sec->terrainnum[0]);
|
||||
P_SerializeTerrain(arc, sec->terrainnum[1]);
|
||||
arc << sec->damageamount;
|
||||
arc << sec->damageinterval
|
||||
<< sec->leakydamage
|
||||
<< sec->damagetype;
|
||||
arc << sec->SoundTarget
|
||||
<< sec->SecActTarget
|
||||
<< sec->sky
|
||||
|
@ -422,13 +371,6 @@ void P_SerializeWorld (FArchive &arc)
|
|||
<< sec->Flags
|
||||
<< sec->SkyBoxes[sector_t::floor] << sec->SkyBoxes[sector_t::ceiling]
|
||||
<< sec->ZoneNumber;
|
||||
if (SaveVersion < 4529)
|
||||
{
|
||||
short secretsector;
|
||||
arc << secretsector;
|
||||
if (secretsector) sec->Flags |= SECF_WASSECRET;
|
||||
P_InitSectorSpecial(sec, sec->special, true);
|
||||
}
|
||||
arc << sec->interpolations[0]
|
||||
<< sec->interpolations[1]
|
||||
<< sec->interpolations[2]
|
||||
|
@ -461,11 +403,6 @@ void P_SerializeWorld (FArchive &arc)
|
|||
<< li->special
|
||||
<< li->Alpha;
|
||||
|
||||
if (SaveVersion < 4523)
|
||||
{
|
||||
int id;
|
||||
arc << id;
|
||||
}
|
||||
if (P_IsACSSpecial(li->special))
|
||||
{
|
||||
P_SerializeACSScriptNumber(arc, li->args[0], false);
|
||||
|
@ -476,12 +413,7 @@ void P_SerializeWorld (FArchive &arc)
|
|||
}
|
||||
arc << li->args[1] << li->args[2] << li->args[3] << li->args[4];
|
||||
|
||||
if (SaveVersion >= 4532)
|
||||
{
|
||||
arc << li->portalindex;
|
||||
}
|
||||
else li->portalindex = UINT_MAX;
|
||||
|
||||
arc << li->portalindex;
|
||||
for (j = 0; j < 2; j++)
|
||||
{
|
||||
if (li->sidedef[j] == NULL)
|
||||
|
@ -517,14 +449,7 @@ void P_SerializeWorld (FArchive &arc)
|
|||
arc << zn->Environment;
|
||||
}
|
||||
|
||||
if (SaveVersion >= 4532)
|
||||
{
|
||||
arc << linePortals;
|
||||
}
|
||||
else
|
||||
{
|
||||
linePortals.Clear();
|
||||
}
|
||||
arc << linePortals;
|
||||
P_CollectLinkedPortals();
|
||||
}
|
||||
|
||||
|
|
|
@ -1052,24 +1052,12 @@ double sector_t::NextLowestFloorAt(double x, double y, double z, int flags, doub
|
|||
|
||||
FArchive &operator<< (FArchive &arc, secspecial_t &p)
|
||||
{
|
||||
if (SaveVersion < 4529)
|
||||
{
|
||||
int special;
|
||||
arc << special;
|
||||
sector_t sec;
|
||||
memset(&sec, 0, sizeof(sec));
|
||||
P_InitSectorSpecial(&sec, special, true);
|
||||
sec.GetSpecial(&p);
|
||||
}
|
||||
else
|
||||
{
|
||||
arc << p.special
|
||||
<< p.damageamount
|
||||
<< p.damagetype
|
||||
<< p.damageinterval
|
||||
<< p.leakydamage
|
||||
<< p.Flags;
|
||||
}
|
||||
arc << p.special
|
||||
<< p.damageamount
|
||||
<< p.damagetype
|
||||
<< p.damageinterval
|
||||
<< p.leakydamage
|
||||
<< p.Flags;
|
||||
return arc;
|
||||
}
|
||||
|
||||
|
|
|
@ -665,16 +665,7 @@ IMPLEMENT_CLASS (DLightTransfer)
|
|||
void DLightTransfer::Serialize (FArchive &arc)
|
||||
{
|
||||
Super::Serialize (arc);
|
||||
if (SaveVersion < 3223)
|
||||
{
|
||||
BYTE bytelight;
|
||||
arc << bytelight;
|
||||
LastLight = bytelight;
|
||||
}
|
||||
else
|
||||
{
|
||||
arc << LastLight;
|
||||
}
|
||||
arc << LastLight;
|
||||
arc << Source << TargetTag << CopyFloor;
|
||||
}
|
||||
|
||||
|
@ -762,16 +753,7 @@ IMPLEMENT_CLASS (DWallLightTransfer)
|
|||
void DWallLightTransfer::Serialize (FArchive &arc)
|
||||
{
|
||||
Super::Serialize (arc);
|
||||
if (SaveVersion < 3223)
|
||||
{
|
||||
BYTE bytelight;
|
||||
arc << bytelight;
|
||||
LastLight = bytelight;
|
||||
}
|
||||
else
|
||||
{
|
||||
arc << LastLight;
|
||||
}
|
||||
arc << LastLight;
|
||||
arc << Source << TargetID << Flags;
|
||||
}
|
||||
|
||||
|
@ -1058,7 +1040,7 @@ static void P_SetupSectorDamage(sector_t *sector, int damage, int interval, int
|
|||
// ('fromload' is necessary to allow conversion upon savegame load.)
|
||||
//
|
||||
|
||||
void P_InitSectorSpecial(sector_t *sector, int special, bool nothinkers)
|
||||
void P_InitSectorSpecial(sector_t *sector, int special)
|
||||
{
|
||||
// [RH] All secret sectors are marked with a BOOM-ish bitfield
|
||||
if (sector->special & SECRET_MASK)
|
||||
|
@ -1093,28 +1075,28 @@ void P_InitSectorSpecial(sector_t *sector, int special, bool nothinkers)
|
|||
switch (sector->special)
|
||||
{
|
||||
case Light_Phased:
|
||||
if (!nothinkers) new DPhased (sector, 48, 63 - (sector->lightlevel & 63));
|
||||
new DPhased (sector, 48, 63 - (sector->lightlevel & 63));
|
||||
break;
|
||||
|
||||
// [RH] Hexen-like phased lighting
|
||||
case LightSequenceStart:
|
||||
if (!nothinkers) new DPhased (sector);
|
||||
new DPhased (sector);
|
||||
break;
|
||||
|
||||
case dLight_Flicker:
|
||||
if (!nothinkers) new DLightFlash (sector);
|
||||
new DLightFlash (sector);
|
||||
break;
|
||||
|
||||
case dLight_StrobeFast:
|
||||
if (!nothinkers) new DStrobe (sector, STROBEBRIGHT, FASTDARK, false);
|
||||
new DStrobe (sector, STROBEBRIGHT, FASTDARK, false);
|
||||
break;
|
||||
|
||||
case dLight_StrobeSlow:
|
||||
if (!nothinkers) new DStrobe (sector, STROBEBRIGHT, SLOWDARK, false);
|
||||
new DStrobe (sector, STROBEBRIGHT, SLOWDARK, false);
|
||||
break;
|
||||
|
||||
case dLight_Strobe_Hurt:
|
||||
if (!nothinkers) new DStrobe (sector, STROBEBRIGHT, FASTDARK, false);
|
||||
new DStrobe (sector, STROBEBRIGHT, FASTDARK, false);
|
||||
P_SetupSectorDamage(sector, 20, 32, 5, NAME_Slime, 0);
|
||||
break;
|
||||
|
||||
|
@ -1127,7 +1109,7 @@ void P_InitSectorSpecial(sector_t *sector, int special, bool nothinkers)
|
|||
break;
|
||||
|
||||
case dLight_Glow:
|
||||
if (!nothinkers) new DGlow (sector);
|
||||
new DGlow (sector);
|
||||
break;
|
||||
|
||||
case dSector_DoorCloseIn30:
|
||||
|
@ -1139,11 +1121,11 @@ void P_InitSectorSpecial(sector_t *sector, int special, bool nothinkers)
|
|||
break;
|
||||
|
||||
case dLight_StrobeSlowSync:
|
||||
if (!nothinkers) new DStrobe (sector, STROBEBRIGHT, SLOWDARK, true);
|
||||
new DStrobe (sector, STROBEBRIGHT, SLOWDARK, true);
|
||||
break;
|
||||
|
||||
case dLight_StrobeFastSync:
|
||||
if (!nothinkers) new DStrobe (sector, STROBEBRIGHT, FASTDARK, true);
|
||||
new DStrobe (sector, STROBEBRIGHT, FASTDARK, true);
|
||||
break;
|
||||
|
||||
case dSector_DoorRaiseIn5Mins:
|
||||
|
@ -1161,7 +1143,7 @@ void P_InitSectorSpecial(sector_t *sector, int special, bool nothinkers)
|
|||
break;
|
||||
|
||||
case dLight_FireFlicker:
|
||||
if (!nothinkers) new DFireFlicker (sector);
|
||||
new DFireFlicker (sector);
|
||||
break;
|
||||
|
||||
case dDamage_LavaWimpy:
|
||||
|
@ -1174,11 +1156,8 @@ void P_InitSectorSpecial(sector_t *sector, int special, bool nothinkers)
|
|||
|
||||
case dScroll_EastLavaDamage:
|
||||
P_SetupSectorDamage(sector, 5, 32, 256, NAME_Fire, SECF_DMGTERRAINFX);
|
||||
if (!nothinkers)
|
||||
{
|
||||
new DStrobe(sector, STROBEBRIGHT, FASTDARK, false);
|
||||
P_CreateScroller(EScroll::sc_floor, -4., 0, -1, int(sector - sectors), 0);
|
||||
}
|
||||
new DStrobe(sector, STROBEBRIGHT, FASTDARK, false);
|
||||
P_CreateScroller(EScroll::sc_floor, -4., 0, -1, int(sector - sectors), 0);
|
||||
keepspecial = true;
|
||||
break;
|
||||
|
||||
|
@ -1188,7 +1167,7 @@ void P_InitSectorSpecial(sector_t *sector, int special, bool nothinkers)
|
|||
|
||||
case sLight_Strobe_Hurt:
|
||||
P_SetupSectorDamage(sector, 5, 32, 0, NAME_Slime, 0);
|
||||
if (!nothinkers) new DStrobe (sector, STROBEBRIGHT, FASTDARK, false);
|
||||
new DStrobe (sector, STROBEBRIGHT, FASTDARK, false);
|
||||
break;
|
||||
|
||||
case sDamage_Hellslime:
|
||||
|
@ -1237,13 +1216,13 @@ void P_InitSectorSpecial(sector_t *sector, int special, bool nothinkers)
|
|||
int i = sector->special - Scroll_North_Slow;
|
||||
double dx = hexenScrollies[i][0] / 2.;
|
||||
double dy = hexenScrollies[i][1] / 2.;
|
||||
if (!nothinkers) P_CreateScroller(EScroll::sc_floor, dx, dy, -1, int(sector-sectors), 0);
|
||||
P_CreateScroller(EScroll::sc_floor, dx, dy, -1, int(sector-sectors), 0);
|
||||
}
|
||||
else if (sector->special >= Carry_East5 &&
|
||||
sector->special <= Carry_East35)
|
||||
{ // Heretic scroll special
|
||||
// Only east scrollers also scroll the texture
|
||||
if (!nothinkers) P_CreateScroller(EScroll::sc_floor,
|
||||
P_CreateScroller(EScroll::sc_floor,
|
||||
-0.5 * (1 << ((sector->special & 0xff) - Carry_East5)), 0, -1, int(sector-sectors), 0);
|
||||
}
|
||||
keepspecial = true;
|
||||
|
@ -1272,7 +1251,7 @@ void P_SpawnSpecials (void)
|
|||
if (sector->special == 0)
|
||||
continue;
|
||||
|
||||
P_InitSectorSpecial(sector, sector->special, false);
|
||||
P_InitSectorSpecial(sector, sector->special);
|
||||
}
|
||||
|
||||
#ifndef NO_EDATA
|
||||
|
|
123
src/p_user.cpp
123
src/p_user.cpp
|
@ -643,28 +643,10 @@ void APlayerPawn::Serialize (FArchive &arc)
|
|||
<< DamageFade
|
||||
<< PlayerFlags
|
||||
<< FlechetteType;
|
||||
if (SaveVersion < 3829)
|
||||
{
|
||||
GruntSpeed = 12;
|
||||
FallingScreamMinSpeed = 35;
|
||||
FallingScreamMaxSpeed = 40;
|
||||
}
|
||||
else
|
||||
{
|
||||
arc << GruntSpeed << FallingScreamMinSpeed << FallingScreamMaxSpeed;
|
||||
}
|
||||
if (SaveVersion >= 4502)
|
||||
{
|
||||
arc << UseRange;
|
||||
}
|
||||
if (SaveVersion >= 4503)
|
||||
{
|
||||
arc << AirCapacity;
|
||||
}
|
||||
if (SaveVersion >= 4526)
|
||||
{
|
||||
arc << ViewHeight;
|
||||
}
|
||||
arc << GruntSpeed << FallingScreamMinSpeed << FallingScreamMaxSpeed;
|
||||
arc << UseRange;
|
||||
arc << AirCapacity;
|
||||
arc << ViewHeight;
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
|
@ -3039,11 +3021,6 @@ void player_t::Serialize (FArchive &arc)
|
|||
<< centering
|
||||
<< health
|
||||
<< inventorytics;
|
||||
if (SaveVersion < 4513)
|
||||
{
|
||||
bool backpack;
|
||||
arc << backpack;
|
||||
}
|
||||
arc << fragcount
|
||||
<< spreecount
|
||||
<< multicount
|
||||
|
@ -3074,50 +3051,14 @@ void player_t::Serialize (FArchive &arc)
|
|||
<< air_finished
|
||||
<< turnticks
|
||||
<< oldbuttons;
|
||||
if (SaveVersion >= 4929)
|
||||
{
|
||||
arc << hazardtype
|
||||
<< hazardinterval;
|
||||
}
|
||||
bool IsBot = false;
|
||||
if (SaveVersion >= 4514)
|
||||
{
|
||||
arc << Bot;
|
||||
}
|
||||
else
|
||||
{
|
||||
arc << IsBot;
|
||||
}
|
||||
arc << hazardtype
|
||||
<< hazardinterval;
|
||||
arc << Bot;
|
||||
arc << BlendR
|
||||
<< BlendG
|
||||
<< BlendB
|
||||
<< BlendA;
|
||||
if (SaveVersion < 3427)
|
||||
{
|
||||
WORD oldaccuracy, oldstamina;
|
||||
arc << oldaccuracy << oldstamina;
|
||||
if (mo != NULL)
|
||||
{
|
||||
mo->accuracy = oldaccuracy;
|
||||
mo->stamina = oldstamina;
|
||||
}
|
||||
}
|
||||
if (SaveVersion < 4041)
|
||||
{
|
||||
// Move weapon state flags from cheats and into WeaponState.
|
||||
WeaponState = ((cheats >> 14) & 1) | ((cheats & (0x37 << 24)) >> (24 - 1));
|
||||
cheats &= ~((1 << 14) | (0x37 << 24));
|
||||
}
|
||||
if (SaveVersion < 4527)
|
||||
{
|
||||
BYTE oldWeaponState;
|
||||
arc << oldWeaponState;
|
||||
WeaponState = oldWeaponState;
|
||||
}
|
||||
else
|
||||
{
|
||||
arc << WeaponState;
|
||||
}
|
||||
arc << WeaponState;
|
||||
arc << LogText
|
||||
<< ConversationNPC
|
||||
<< ConversationPC
|
||||
|
@ -3137,45 +3078,10 @@ void player_t::Serialize (FArchive &arc)
|
|||
<< crouchviewdelta
|
||||
<< original_cmd
|
||||
<< original_oldbuttons;
|
||||
|
||||
if (SaveVersion >= 3475)
|
||||
{
|
||||
arc << poisontype << poisonpaintype;
|
||||
}
|
||||
else if (poisoner != NULL)
|
||||
{
|
||||
poisontype = poisoner->DamageType;
|
||||
poisonpaintype = poisoner->PainType != NAME_None ? poisoner->PainType : poisoner->DamageType;
|
||||
}
|
||||
|
||||
if (SaveVersion >= 3599)
|
||||
{
|
||||
arc << timefreezer;
|
||||
}
|
||||
else
|
||||
{
|
||||
cheats &= ~(1 << 15); // make sure old CF_TIMEFREEZE bit is cleared
|
||||
}
|
||||
if (SaveVersion < 3640)
|
||||
{
|
||||
cheats &= ~(1 << 17); // make sure old CF_REGENERATION bit is cleared
|
||||
}
|
||||
if (SaveVersion >= 3780)
|
||||
{
|
||||
arc << settings_controller;
|
||||
}
|
||||
else
|
||||
{
|
||||
settings_controller = (this - players == Net_Arbitrator);
|
||||
}
|
||||
if (SaveVersion >= 4505)
|
||||
{
|
||||
arc << onground;
|
||||
}
|
||||
else
|
||||
{
|
||||
onground = (mo->Z() <= mo->floorz) || (mo->flags2 & MF2_ONMOBJ) || (mo->BounceFlags & BOUNCE_MBF) || (cheats & CF_NOCLIP2);
|
||||
}
|
||||
arc << poisontype << poisonpaintype;
|
||||
arc << timefreezer;
|
||||
arc << settings_controller;
|
||||
arc << onground;
|
||||
|
||||
if (arc.IsLoading ())
|
||||
{
|
||||
|
@ -3188,10 +3094,7 @@ void player_t::Serialize (FArchive &arc)
|
|||
{
|
||||
userinfo.SkinChanged(skinname, CurrentPlayerClass);
|
||||
}
|
||||
if (SaveVersion >= 4522)
|
||||
{
|
||||
arc << MUSINFOactor << MUSINFOtics;
|
||||
}
|
||||
arc << MUSINFOactor << MUSINFOtics;
|
||||
}
|
||||
|
||||
bool P_IsPlayerTotallyFrozen(const player_t *player)
|
||||
|
|
|
@ -72,11 +72,11 @@ const char *GetVersionString();
|
|||
// SAVESIG should match SAVEVER.
|
||||
|
||||
// MINSAVEVER is the minimum level snapshot version that can be loaded.
|
||||
#define MINSAVEVER 4535
|
||||
#define MINSAVEVER 4536
|
||||
|
||||
// Use 4500 as the base git save version, since it's higher than the
|
||||
// SVN revision ever got.
|
||||
#define SAVEVER 4535
|
||||
#define SAVEVER 4536
|
||||
|
||||
#define SAVEVERSTRINGIFY2(x) #x
|
||||
#define SAVEVERSTRINGIFY(x) SAVEVERSTRINGIFY2(x)
|
||||
|
|
Loading…
Reference in a new issue