CON: Handle the save and savenn commands after the full tic is processed, instead of in the middle of it during execution. DONT_BUILD.

git-svn-id: https://svn.eduke32.com/eduke32@6222 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
hendricks266 2017-06-22 22:49:22 +00:00
parent 262e863b33
commit e2c44ae253
4 changed files with 28 additions and 15 deletions

View file

@ -6665,6 +6665,24 @@ MAIN_LOOP_RESTART:
while (((g_netClient || g_netServer) || !(g_player[myconnectindex].ps->gm & (MODE_MENU|MODE_DEMO))) && totalclock >= ototalclock+TICSPERFRAME);
}
// handle CON_SAVE and CON_SAVENN
if (g_requestedSaveSlot != -1)
{
g_lastSaveSlot = g_requestedSaveSlot;
OSD_Printf("Saving to slot %d\n", g_requestedSaveSlot);
KB_FlushKeyboardQueue();
g_screenCapture = 1;
G_DrawRooms(myconnectindex, 65536);
g_screenCapture = 0;
G_SavePlayerMaybeMulti(g_requestedSaveSlot);
g_requestedSaveSlot = -1;
}
G_DoCheats();
if (g_player[myconnectindex].ps->gm & (MODE_EOL|MODE_RESTART))

View file

@ -3479,31 +3479,23 @@ nullquote:
case CON_SAVE:
insptr++;
{
g_lastSaveSlot = *insptr++;
int32_t const requestedSlot = *insptr++;
if ((unsigned)g_lastSaveSlot >= MAXSAVEGAMES)
if ((unsigned)requestedSlot >= MAXSAVEGAMES)
continue;
if (tw == CON_SAVE || ud.savegame[g_lastSaveSlot][0] == 0)
g_requestedSaveSlot = requestedSlot;
if (tw == CON_SAVE || ud.savegame[requestedSlot][0] == 0)
{
time_t timeStruct = time(NULL);
struct tm *pTime = localtime(&timeStruct);
Bsnprintf(ud.savegame[g_lastSaveSlot], sizeof(ud.savegame[g_lastSaveSlot]),
"Auto %.4d%.2d%.2d %.2d%.2d%.2d\n", pTime->tm_year + 1900, pTime->tm_mon + 1, pTime->tm_mday,
Bsnprintf(ud.savegame[requestedSlot], sizeof(ud.savegame[requestedSlot]),
"Auto %.4d%.2d%.2d %.2d%.2d%.2d", pTime->tm_year + 1900, pTime->tm_mon + 1, pTime->tm_mday,
pTime->tm_hour, pTime->tm_min, pTime->tm_sec);
}
OSD_Printf("Saving to slot %d\n",g_lastSaveSlot);
KB_FlushKeyboardQueue();
g_screenCapture = 1;
G_DrawRooms(myconnectindex,65536);
g_screenCapture = 0;
G_SavePlayerMaybeMulti(g_lastSaveSlot);
continue;
}

View file

@ -60,6 +60,8 @@ int g_bouncemineRadius = 2500;
int g_deleteQueueSize = 64;
int g_itemRespawnTime = 768;
int g_lastSaveSlot = -1;
int32_t g_requestedSaveSlot = -1;
int g_morterRadius = 2500;
int g_numFreezeBounces = 3;
int g_gametypeCnt = 5;

View file

@ -175,6 +175,7 @@ extern int32_t g_deleteQueueSize;
extern int32_t g_gametypeCnt;
extern int32_t g_itemRespawnTime;
extern int32_t g_lastSaveSlot;
extern int32_t g_requestedSaveSlot;
extern int32_t g_morterRadius;
extern int32_t g_numFreezeBounces;
extern int32_t g_pipebombRadius;