Hopefully? fixed CTF issues
This commit is contained in:
1 parent
f8a0eefa1a
commit
47e3616b4a
4 files changed
+44
-3
No files matched your search
+37
-2
@@ -5335,8 +5335,9 @@ void TryRunTics(tic_t realtics)
|
||||
}
|
||||
|
||||
// record the actual local controls
|
||||
boolean canSimulate = (gamestate == GS_LEVEL) && leveltime >= 10 && gametic >= BACKUPTICS && (cv_simulate.value && !server);
|
||||
boolean recordingStates = (gamestate == GS_LEVEL) && leveltime >= 10 && gametic >= BACKUPTICS;
|
||||
static boolean didSimulate = false;
|
||||
boolean canSimulate = (gamestate == GS_LEVEL) && leveltime >= BACKUPTICS && gametic >= BACKUPTICS && (cv_simulate.value && !server);
|
||||
boolean recordingStates = (gamestate == GS_LEVEL) && leveltime >= BACKUPTICS && gametic >= BACKUPTICS;
|
||||
boolean preserveSoundDisabled = sound_disabled;
|
||||
int numNewTics = neededtic - gametic;
|
||||
|
||||
@@ -5344,6 +5345,24 @@ void TryRunTics(tic_t realtics)
|
||||
angle_t preservedAngle = localangle[0];
|
||||
INT32 preservedAiming = localaiming[0];
|
||||
|
||||
if (didSimulate && !canSimulate)
|
||||
{
|
||||
// we've stopped simulating for a while, so restore the original state before continuing
|
||||
if (gameStateBufferIsValid[gametic % BACKUPTICS]) {
|
||||
sound_disabled = true;
|
||||
|
||||
save_p = gameStateBuffer[gametic % BACKUPTICS];
|
||||
P_LoadNetGame(true);
|
||||
|
||||
sound_disabled = preserveSoundDisabled;
|
||||
}
|
||||
|
||||
// clear previous states
|
||||
for (int i = 0; i < BACKUPTICS; i++) {
|
||||
gameStateBufferIsValid[i] = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (recordingStates)
|
||||
{
|
||||
PerformDebugRewinds();
|
||||
@@ -5500,6 +5519,8 @@ void TryRunTics(tic_t realtics)
|
||||
smoothedTic = gametic;
|
||||
}
|
||||
|
||||
didSimulate = simTic != gametic || smoothedTic != gametic;
|
||||
|
||||
// we're gonna need more debugs...
|
||||
MakeNetDebugString();
|
||||
}
|
||||
@@ -5561,6 +5582,13 @@ static void PerformDebugRewinds() {
|
||||
/* sector_t initial = *((elevator_t*)thlist[1].next)->sector;
|
||||
mobj_t initialPlayer = *players[consoleplayer].mo;*/
|
||||
|
||||
int xyz = 0;
|
||||
mapthing_t spawnpoint;
|
||||
if (redflag) {
|
||||
xyz = redflag->spawnpoint->x + redflag->spawnpoint->y + redflag->spawnpoint->z;
|
||||
spawnpoint = *(redflag->spawnpoint);
|
||||
}
|
||||
|
||||
for (int i = 0; i < cv_debugsimulaterewind.value; i++) {
|
||||
G_Ticker(true);
|
||||
}
|
||||
@@ -5568,6 +5596,13 @@ static void PerformDebugRewinds() {
|
||||
save_p = gameStateBuffer[gametic % BACKUPTICS];
|
||||
P_LoadNetGame(true);
|
||||
|
||||
if (redflag) {
|
||||
if (redflag->spawnpoint->x + redflag->spawnpoint->y + redflag->spawnpoint->z != xyz && xyz != 0)
|
||||
{
|
||||
CONS_Printf("Flag consistency error!\n");
|
||||
}
|
||||
}
|
||||
|
||||
/*sector_t current = *((elevator_t*)thlist[1].next)->sector;
|
||||
mobj_t currentPlayer = *players[consoleplayer].mo;*/
|
||||
|
||||
|
||||
+1
-1
@@ -924,7 +924,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
|
||||
if (player->powers[pw_super])
|
||||
return;
|
||||
|
||||
player->gotflag |= flagflag;
|
||||
player->gotflag |= flagflag; // >:(
|
||||
CONS_Printf(M_GetText("%s picked up the %c%s%c!\n"), plname, flagcolor, flagtext, 0x80);
|
||||
(*flagmobj) = NULL;
|
||||
// code for dealing with abilities is handled elsewhere now
|
||||
|
||||
@@ -9194,6 +9194,8 @@ void P_MobjThinker(mobj_t *mobj)
|
||||
|
||||
blueflag = flagmo;
|
||||
}
|
||||
|
||||
CONS_Printf("Flag respawning at %d,%d,%d type %d\n", mobj->spawnpoint->x, mobj->spawnpoint->y, mobj->spawnpoint->z, mobj->spawnpoint->type);
|
||||
}
|
||||
P_RemoveMobj(mobj);
|
||||
return;
|
||||
|
||||
@@ -2870,6 +2870,10 @@ static void P_NetUnArchiveThinkers(void)
|
||||
sectors[i].floordata = sectors[i].ceilingdata = sectors[i].lightingdata = NULL;
|
||||
}
|
||||
|
||||
// clear flags (necessary for level-preserving loads)
|
||||
redflag = NULL;
|
||||
blueflag = NULL;
|
||||
|
||||
// read in saved thinkers
|
||||
for (;;)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user