- Modified the way autosaves are done. Instead of setting gameaction to

ga_autosave, write DEM_CHECKAUTOSAVE to the net stream. When this is
  processed, it will check if it's okay to do an autosave. If it is, it writes
  DEM_DOAUTOSAVE to the net stream, which the sets gameaction to ga_autosave.
  Essentially, about half of the functionality was moved out of G_DoAutoSave()
  and into Net_DoCommand().
- Minor changes to OS detection: The os_WinNT enumeration has been renamed to
  os_WinNT4, since every new OS coming out of Microsoft these days is
  essentially NT. NT 5.2 and 6.0 are now properly identified as "Windows
  Server 2003" and "Windows Vista" respectively, and any unknown NT versions
  Microsoft introduces in the future will now be displayed as "Windows NT"
  instead of "Windows 2000" if the minor version is 0 and "Windows XP" if the
  minor version is non-0. Win32s detection has also been removed. Presumably
  if somebody is foolish enough to try to run this on Windows 3.x with Win32s,
  it won't even load due to missing DLLs.
- Fixed: Demos with NETD chunks should not set netgame to true unless they
  have more than one player. And since netdemo is ignored if netgame is
  false, it doesn't need to set that either.
- Fixed: FTexture::GetScaled* functions did not check for scale values of 0.


SVN r354 (trunk)
This commit is contained in:
Randy Heit 2006-10-19 20:20:56 +00:00
commit 7c1fbe7ee5
13 changed files with 89 additions and 54 deletions

View file

@ -97,7 +97,7 @@ void G_DoCompleted (void);
void G_DoVictory (void);
void G_DoWorldDone (void);
void G_DoSaveGame (bool okForQuicksave);
void G_DoAutoSave (void);
void G_DoAutoSave ();
FIntCVar gameskill ("skill", 2, CVAR_SERVERINFO|CVAR_LATCH);
CVAR (Int, deathmatch, 0, CVAR_SERVERINFO|CVAR_LATCH);
@ -1700,7 +1700,9 @@ void G_DoLoadGame ()
// load a base level
savegamerestore = true; // Use the player actors in the savegame
bool demoplaybacksave = demoplayback;
G_InitNew (map, false);
demoplayback = demoplaybacksave;
delete[] map;
savegamerestore = false;
@ -1802,22 +1804,12 @@ extern void P_CalcHeight (player_t *);
void G_DoAutoSave ()
{
// Do not autosave in multiplayer games or demos or when dead
if (multiplayer ||
demoplayback ||
players[consoleplayer].playerstate != PST_LIVE ||
disableautosave >= 2 ||
autosavecount == 0)
{
gameaction = ga_nothing;
return;
}
// Keep up to four autosaves at a time
UCVarValue num;
char *readableTime;
int count = autosavecount != 0 ? autosavecount : 1;
num.Int = (autosavenum + 1) % autosavecount;
num.Int = (autosavenum + 1) % count;
autosavenum.ForceSet (num, CVAR_Int);
savegamefile = G_BuildSaveName ("auto", num.Int);
@ -1967,11 +1959,10 @@ void G_DoSaveGame (bool okForQuicksave)
{
if (demoplayback)
{
gameaction = ga_nothing;
return;
savegamefile = G_BuildSaveName ("demosave.zds", -1);
}
insave=true;
insave = true;
G_SnapshotLevel ();
FILE *stdfile = fopen (savegamefile.GetChars(), "wb");
@ -2368,7 +2359,7 @@ bool G_ProcessIFFDemo (char *mapname)
break;
case NETD_ID:
multiplayer = netgame = netdemo = true;
multiplayer = true;
break;
case BODY_ID: