mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2025-03-25 12:21:06 +00:00
Resend Gamestate instead of Resynching port
port of https://git.do.srb2.org/STJr/SRB2/-/merge_requests/829 With a few changes accomidating karts code
This commit is contained in:
parent
ea49b16a02
commit
a1874036f1
10 changed files with 276 additions and 1025 deletions
946
src/d_clisrv.c
946
src/d_clisrv.c
File diff suppressed because it is too large
Load diff
162
src/d_clisrv.h
162
src/d_clisrv.h
|
@ -67,8 +67,9 @@ typedef enum
|
|||
PT_REQUESTFILE, // Client requests a file transfer
|
||||
PT_ASKINFOVIAMS, // Packet from the MS requesting info be sent to new client.
|
||||
// If this ID changes, update masterserver definition.
|
||||
PT_RESYNCHEND, // Player is now resynched and is being requested to remake the gametic
|
||||
PT_RESYNCHGET, // Player got resynch packet
|
||||
PT_WILLRESENDGAMESTATE, // Hey Client, I am about to resend you the gamestate!
|
||||
PT_CANRECEIVEGAMESTATE, // Okay Server, I'm ready to receive it, you can go ahead.
|
||||
PT_RECEIVEDGAMESTATE, // Thank you Server, I am ready to play again!
|
||||
|
||||
// Add non-PT_CANFAIL packet types here to avoid breaking MS compatibility.
|
||||
|
||||
|
@ -91,8 +92,6 @@ typedef enum
|
|||
PT_TEXTCMD4, // 4P
|
||||
PT_CLIENTJOIN, // Client wants to join; used in start game.
|
||||
PT_NODETIMEOUT, // Packet sent to self if the connection times out.
|
||||
PT_RESYNCHING, // Packet sent to resync players.
|
||||
// Blocks game advance until synched.
|
||||
|
||||
PT_TELLFILESNEEDED, // Client, to server: "what other files do I need starting from this number?"
|
||||
PT_MOREFILESNEEDED, // Server, to client: "you need these (+ more on top of those)"
|
||||
|
@ -166,149 +165,6 @@ typedef struct
|
|||
ticcmd_t cmds[45]; // Normally [BACKUPTIC][MAXPLAYERS] but too large
|
||||
} ATTRPACK servertics_pak;
|
||||
|
||||
// Sent to client when all consistency data
|
||||
// for players has been restored
|
||||
typedef struct
|
||||
{
|
||||
UINT32 randomseed;
|
||||
|
||||
// CTF flag stuff
|
||||
SINT8 flagplayer[2];
|
||||
INT32 flagloose[2];
|
||||
INT32 flagflags[2];
|
||||
fixed_t flagx[2];
|
||||
fixed_t flagy[2];
|
||||
fixed_t flagz[2];
|
||||
|
||||
UINT32 ingame; // Spectator bit for each player
|
||||
INT32 ctfteam[MAXPLAYERS]; // Which team? (can't be 1 bit, since in regular Match there are no teams)
|
||||
|
||||
// Resynch game scores and the like all at once
|
||||
UINT32 score[MAXPLAYERS]; // Everyone's score
|
||||
UINT32 marescore[MAXPLAYERS]; // SRB2kart: Battle score
|
||||
tic_t realtime[MAXPLAYERS];
|
||||
UINT8 laps[MAXPLAYERS];
|
||||
} ATTRPACK resynchend_pak;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
// Player stuff
|
||||
UINT8 playernum;
|
||||
|
||||
// Do not send anything visual related.
|
||||
// Only send data that we need to know for physics.
|
||||
UINT8 playerstate; // playerstate_t
|
||||
UINT32 pflags; // pflags_t
|
||||
UINT8 panim; // panim_t
|
||||
|
||||
angle_t aiming;
|
||||
INT32 currentweapon;
|
||||
INT32 ringweapons;
|
||||
|
||||
UINT16 powers[NUMPOWERS];
|
||||
|
||||
INT32 kartstuff[NUMKARTSTUFF]; // SRB2kart
|
||||
angle_t frameangle; // SRB2kart
|
||||
|
||||
// Score is resynched in the confirm resync packet
|
||||
INT32 health;
|
||||
SINT8 lives;
|
||||
SINT8 continues;
|
||||
UINT8 scoreadd;
|
||||
SINT8 xtralife;
|
||||
SINT8 pity;
|
||||
|
||||
UINT8 skincolor;
|
||||
INT32 skin;
|
||||
// Just in case Lua does something like
|
||||
// modify these at runtime
|
||||
// SRB2kart
|
||||
UINT8 kartspeed;
|
||||
UINT8 kartweight;
|
||||
//
|
||||
UINT32 charflags;
|
||||
|
||||
fixed_t speed;
|
||||
UINT8 jumping;
|
||||
UINT8 secondjump;
|
||||
UINT8 fly1;
|
||||
tic_t glidetime;
|
||||
UINT8 climbing;
|
||||
INT32 deadtimer;
|
||||
tic_t exiting;
|
||||
UINT8 homing;
|
||||
tic_t skidtime;
|
||||
fixed_t cmomx;
|
||||
fixed_t cmomy;
|
||||
fixed_t rmomx;
|
||||
fixed_t rmomy;
|
||||
|
||||
INT32 weapondelay;
|
||||
INT32 tossdelay;
|
||||
|
||||
INT16 starpostx;
|
||||
INT16 starposty;
|
||||
INT16 starpostz;
|
||||
INT32 starpostnum;
|
||||
tic_t starposttime;
|
||||
angle_t starpostangle;
|
||||
|
||||
INT32 maxlink;
|
||||
fixed_t dashspeed;
|
||||
INT32 dashtime;
|
||||
angle_t angle_pos;
|
||||
angle_t old_angle_pos;
|
||||
tic_t bumpertime;
|
||||
INT32 flyangle;
|
||||
tic_t drilltimer;
|
||||
INT32 linkcount;
|
||||
tic_t linktimer;
|
||||
INT32 anotherflyangle;
|
||||
tic_t nightstime;
|
||||
INT32 drillmeter;
|
||||
UINT8 drilldelay;
|
||||
UINT8 bonustime;
|
||||
UINT8 mare;
|
||||
INT16 lastsidehit, lastlinehit;
|
||||
|
||||
tic_t losstime;
|
||||
UINT8 timeshit;
|
||||
INT32 onconveyor;
|
||||
|
||||
tic_t jointime;
|
||||
tic_t spectatorreentry;
|
||||
|
||||
tic_t grieftime;
|
||||
UINT8 griefstrikes;
|
||||
|
||||
UINT8 splitscreenindex;
|
||||
|
||||
//player->mo stuff
|
||||
UINT8 hasmo; // Boolean
|
||||
|
||||
angle_t angle;
|
||||
fixed_t x;
|
||||
fixed_t y;
|
||||
fixed_t z;
|
||||
fixed_t momx;
|
||||
fixed_t momy;
|
||||
fixed_t momz;
|
||||
fixed_t friction;
|
||||
fixed_t movefactor;
|
||||
|
||||
INT32 tics;
|
||||
statenum_t statenum;
|
||||
UINT32 flags;
|
||||
UINT32 flags2;
|
||||
UINT16 eflags;
|
||||
|
||||
fixed_t radius;
|
||||
fixed_t height;
|
||||
fixed_t scale;
|
||||
fixed_t destscale;
|
||||
fixed_t scalespeed;
|
||||
} ATTRPACK resynch_pak;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
UINT8 version; // Different versions don't work
|
||||
|
@ -322,13 +178,8 @@ typedef struct
|
|||
UINT8 clientnode;
|
||||
UINT8 gamestate;
|
||||
|
||||
// 0xFF == not in game; else player skin num
|
||||
UINT8 playerskins[MAXPLAYERS];
|
||||
UINT8 playercolor[MAXPLAYERS];
|
||||
|
||||
UINT8 gametype;
|
||||
UINT8 modifiedgame;
|
||||
SINT8 adminplayers[MAXPLAYERS]; // Needs to be signed
|
||||
|
||||
char server_context[8]; // Unique context id, generated at server startup.
|
||||
|
||||
|
@ -336,8 +187,6 @@ typedef struct
|
|||
UINT8 maxplayer;
|
||||
boolean allownewplayer;
|
||||
boolean discordinvites;
|
||||
|
||||
UINT8 varlengthinputs[0]; // Playernames and netvars
|
||||
} ATTRPACK serverconfig_pak;
|
||||
|
||||
typedef struct {
|
||||
|
@ -471,9 +320,6 @@ typedef struct
|
|||
client4cmd_pak client4pak; // 316 bytes(?)
|
||||
servertics_pak serverpak; // 132495 bytes (more around 360, no?)
|
||||
serverconfig_pak servercfg; // 773 bytes
|
||||
resynchend_pak resynchend; //
|
||||
resynch_pak resynchpak; //
|
||||
UINT8 resynchgot; //
|
||||
UINT8 textcmd[MAXTEXTCMD+1]; // 66049 bytes (wut??? 64k??? More like 257 bytes...)
|
||||
filetx_pak filetxpak; // 139 bytes
|
||||
clientconfig_pak clientcfg; // 153 bytes
|
||||
|
@ -626,7 +472,7 @@ void D_ResetTiccmds(void);
|
|||
tic_t GetLag(INT32 node);
|
||||
UINT8 GetFreeXCmdSize(void);
|
||||
|
||||
extern UINT8 hu_resynching;
|
||||
extern UINT8 hu_redownloadinggamestate;
|
||||
extern UINT8 hu_stopped; // kart, true when the game is stopped for players due to a disconnecting or connecting player
|
||||
|
||||
typedef struct rewind_s {
|
||||
|
|
|
@ -1683,7 +1683,7 @@ void D_SRB2Main(void)
|
|||
pagename = "TITLESKY";
|
||||
levelstarttic = gametic;
|
||||
G_SetGamestate(GS_LEVEL);
|
||||
if (!P_SetupLevel(false))
|
||||
if (!P_SetupLevel(false, false))
|
||||
I_Quit(); // fail so reset game stuff
|
||||
}
|
||||
|
||||
|
|
|
@ -810,8 +810,9 @@ static const char *packettypename[NUMPACKETTYPE] =
|
|||
"REQUESTFILE",
|
||||
"ASKINFOVIAMS",
|
||||
|
||||
"RESYNCHEND",
|
||||
"RESYNCHGET",
|
||||
"WILLRESENDGAMESTATE",
|
||||
"CANRECEIVEGAMESTATE",
|
||||
"RECEIVEDGAMESTATE",
|
||||
|
||||
"CLIENT3CMD",
|
||||
"CLIENT3MIS",
|
||||
|
@ -826,7 +827,6 @@ static const char *packettypename[NUMPACKETTYPE] =
|
|||
"TEXTCMD4",
|
||||
"CLIENTJOIN",
|
||||
"NODETIMEOUT",
|
||||
"RESYNCHING",
|
||||
"PING"
|
||||
};
|
||||
|
||||
|
|
|
@ -1371,8 +1371,8 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer)
|
|||
|
||||
// why build a ticcmd if we're paused?
|
||||
// Or, for that matter, if we're being reborn.
|
||||
// Kart, don't build a ticcmd if someone is resynching or the server is stopped too so we don't fly off course in bad conditions
|
||||
if (paused || P_AutoPause() || (gamestate == GS_LEVEL && player->playerstate == PST_REBORN) || hu_resynching)
|
||||
// Kart, don't build a ticcmd if the server is stopped too so we don't fly off course in bad conditions
|
||||
if (paused || P_AutoPause() || (gamestate == GS_LEVEL && player->playerstate == PST_REBORN))
|
||||
{
|
||||
cmd->angleturn = (INT16)(lang >> 16);
|
||||
cmd->aiming = G_ClipAimingPitch(&laim);
|
||||
|
@ -1821,7 +1821,7 @@ void G_DoLoadLevel(boolean resetplayer)
|
|||
}
|
||||
|
||||
// Setup the level.
|
||||
if (!P_SetupLevel(false))
|
||||
if (!P_SetupLevel(false, false)) // this never returns false?
|
||||
{
|
||||
// fail so reset game stuff
|
||||
Command_ExitGame_f();
|
||||
|
|
|
@ -1118,7 +1118,7 @@ void HU_Ticker(void)
|
|||
if (cechotimer > 0) --cechotimer;
|
||||
|
||||
// Animate the desynch dots
|
||||
if (hu_resynching)
|
||||
if (hu_redownloadinggamestate)
|
||||
resynch_ticker++; //tic tic tic tic tic
|
||||
|
||||
HU_TickSongCredits();
|
||||
|
@ -2442,7 +2442,7 @@ void HU_Drawer(void)
|
|||
HU_DrawSongCredits();
|
||||
|
||||
// draw desynch text
|
||||
if (hu_resynching)
|
||||
if (hu_redownloadinggamestate)
|
||||
{
|
||||
char resynch_text[14];
|
||||
UINT32 i;
|
||||
|
|
|
@ -117,13 +117,16 @@ static void P_NetArchivePlayers(void)
|
|||
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
{
|
||||
WRITESINT8(save_p, (SINT8)adminplayers[i]);
|
||||
|
||||
if (!playeringame[i])
|
||||
continue;
|
||||
|
||||
flags = 0;
|
||||
|
||||
// no longer send ticcmds, player name, skin, or color
|
||||
// no longer send ticcmds
|
||||
|
||||
WRITESTRINGN(save_p, player_names[i], MAXPLAYERNAME);
|
||||
WRITEANGLE(save_p, players[i].aiming);
|
||||
WRITEANGLE(save_p, players[i].awayviewaiming);
|
||||
WRITEINT32(save_p, players[i].awayviewtics);
|
||||
|
@ -148,6 +151,8 @@ static void P_NetArchivePlayers(void)
|
|||
WRITEUINT16(save_p, players[i].flashpal);
|
||||
WRITEUINT16(save_p, players[i].flashcount);
|
||||
|
||||
WRITEUINT8(save_p, players[i].skincolor);
|
||||
WRITEINT32(save_p, players[i].skin);
|
||||
WRITEUINT32(save_p, players[i].score);
|
||||
WRITEFIXED(save_p, players[i].dashspeed);
|
||||
WRITEINT32(save_p, players[i].dashtime);
|
||||
|
@ -295,6 +300,8 @@ static void P_NetUnArchivePlayers(void)
|
|||
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
{
|
||||
adminplayers[i] = (INT32)READSINT8(save_p);
|
||||
|
||||
// Do NOT memset player struct to 0
|
||||
// other areas may initialize data elsewhere
|
||||
//memset(&players[i], 0, sizeof (player_t));
|
||||
|
@ -302,9 +309,8 @@ static void P_NetUnArchivePlayers(void)
|
|||
continue;
|
||||
|
||||
// NOTE: sending tics should (hopefully) no longer be necessary
|
||||
// sending player names, skin and color should not be necessary at all!
|
||||
// (that data is handled in the server config now)
|
||||
|
||||
READSTRINGN(save_p, player_names[i], MAXPLAYERNAME);
|
||||
players[i].aiming = READANGLE(save_p);
|
||||
players[i].awayviewaiming = READANGLE(save_p);
|
||||
players[i].awayviewtics = READINT32(save_p);
|
||||
|
@ -329,6 +335,8 @@ static void P_NetUnArchivePlayers(void)
|
|||
players[i].flashpal = READUINT16(save_p);
|
||||
players[i].flashcount = READUINT16(save_p);
|
||||
|
||||
players[i].skincolor = READUINT8(save_p);
|
||||
players[i].skin = READINT32(save_p);
|
||||
players[i].score = READUINT32(save_p);
|
||||
players[i].dashspeed = READFIXED(save_p); // dashing speed
|
||||
players[i].dashtime = READINT32(save_p); // dashing speed
|
||||
|
@ -3209,18 +3217,21 @@ static inline void P_UnArchiveSPGame(INT16 mapoverride)
|
|||
playeringame[consoleplayer] = true;
|
||||
}
|
||||
|
||||
static void P_NetArchiveMisc(void)
|
||||
static void P_NetArchiveMisc(boolean resending)
|
||||
{
|
||||
UINT32 pig = 0;
|
||||
INT32 i;
|
||||
|
||||
WRITEUINT32(save_p, ARCHIVEBLOCK_MISC);
|
||||
|
||||
if (resending)
|
||||
WRITEUINT32(save_p, gametic);
|
||||
WRITEINT16(save_p, gamemap);
|
||||
if (gamestate != GS_LEVEL)
|
||||
WRITEINT16(save_p, GS_WAITINGPLAYERS); // nice hack to put people back into waitingplayers
|
||||
else
|
||||
WRITEINT16(save_p, gamestate);
|
||||
WRITEINT16(save_p, gametype);
|
||||
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
pig |= (playeringame[i] != 0)<<i;
|
||||
|
@ -3304,7 +3315,7 @@ static void P_NetArchiveMisc(void)
|
|||
WRITEUINT8(save_p, 0x2e);
|
||||
}
|
||||
|
||||
static inline boolean P_NetUnArchiveMisc(void)
|
||||
static inline boolean P_NetUnArchiveMisc(boolean reloading)
|
||||
{
|
||||
UINT32 pig;
|
||||
INT32 i;
|
||||
|
@ -3312,6 +3323,9 @@ static inline boolean P_NetUnArchiveMisc(void)
|
|||
if (READUINT32(save_p) != ARCHIVEBLOCK_MISC)
|
||||
I_Error("Bad $$$.sav at archive block Misc");
|
||||
|
||||
if (reloading)
|
||||
gametic = READUINT32(save_p);
|
||||
|
||||
gamemap = READINT16(save_p);
|
||||
|
||||
// gamemap changed; we assume that its map header is always valid,
|
||||
|
@ -3325,6 +3339,8 @@ static inline boolean P_NetUnArchiveMisc(void)
|
|||
|
||||
G_SetGamestate(READINT16(save_p));
|
||||
|
||||
gametype = READINT16(save_p);
|
||||
|
||||
pig = READUINT32(save_p);
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
{
|
||||
|
@ -3338,7 +3354,7 @@ static inline boolean P_NetUnArchiveMisc(void)
|
|||
|
||||
encoremode = (boolean)READUINT8(save_p);
|
||||
|
||||
if (!P_SetupLevel(true))
|
||||
if (!P_SetupLevel(true, reloading))
|
||||
return false;
|
||||
|
||||
// get the time
|
||||
|
@ -3422,14 +3438,14 @@ void P_SaveGame(void)
|
|||
WRITEUINT8(save_p, 0x1d); // consistency marker
|
||||
}
|
||||
|
||||
void P_SaveNetGame(void)
|
||||
void P_SaveNetGame(boolean resending)
|
||||
{
|
||||
thinker_t *th;
|
||||
mobj_t *mobj;
|
||||
INT32 i = 1; // don't start from 0, it'd be confused with a blank pointer otherwise
|
||||
|
||||
CV_SaveNetVars(&save_p, false);
|
||||
P_NetArchiveMisc();
|
||||
P_NetArchiveMisc(resending);
|
||||
|
||||
// Assign the mobjnumber for pointer tracking
|
||||
if (gamestate == GS_LEVEL)
|
||||
|
@ -3483,10 +3499,10 @@ boolean P_LoadGame(INT16 mapoverride)
|
|||
return true;
|
||||
}
|
||||
|
||||
boolean P_LoadNetGame(void)
|
||||
boolean P_LoadNetGame(boolean reloading)
|
||||
{
|
||||
CV_LoadNetVars(&save_p);
|
||||
if (!P_NetUnArchiveMisc())
|
||||
if (!P_NetUnArchiveMisc(reloading))
|
||||
return false;
|
||||
P_NetUnArchivePlayers();
|
||||
if (gamestate == GS_LEVEL)
|
||||
|
|
|
@ -22,9 +22,9 @@
|
|||
// These are the load / save game routines.
|
||||
|
||||
void P_SaveGame(void);
|
||||
void P_SaveNetGame(void);
|
||||
void P_SaveNetGame(boolean resending);
|
||||
boolean P_LoadGame(INT16 mapoverride);
|
||||
boolean P_LoadNetGame(void);
|
||||
boolean P_LoadNetGame(boolean reloading);
|
||||
|
||||
mobj_t *P_FindNewPosition(UINT32 oldposition);
|
||||
|
||||
|
|
133
src/p_setup.c
133
src/p_setup.c
|
@ -2314,14 +2314,12 @@ lumpnum_t lastloadedmaplumpnum; // for comparative savegame
|
|||
//
|
||||
// Some player initialization for map start.
|
||||
//
|
||||
static void P_LevelInitStuff(void)
|
||||
static void P_LevelInitStuff(boolean reloadinggamestate)
|
||||
{
|
||||
INT32 i;
|
||||
|
||||
leveltime = 0;
|
||||
|
||||
memset(localaiming, 0, sizeof(localaiming));
|
||||
|
||||
// map object scale
|
||||
mapobjectscale = mapheaderinfo[gamemap-1]->mobj_scale;
|
||||
|
||||
|
@ -2349,7 +2347,10 @@ static void P_LevelInitStuff(void)
|
|||
// circuit, race and competition stuff
|
||||
circuitmap = false;
|
||||
numstarposts = 0;
|
||||
totalrings = timeinmap = 0;
|
||||
totalrings = 0;
|
||||
|
||||
if (!reloadinggamestate)
|
||||
timeinmap = 0;
|
||||
|
||||
// special stage
|
||||
stagefailed = false;
|
||||
|
@ -2458,7 +2459,7 @@ void P_LoadThingsOnly(void)
|
|||
P_RemoveMobj(mo);
|
||||
}
|
||||
|
||||
P_LevelInitStuff();
|
||||
P_LevelInitStuff(false);
|
||||
|
||||
if (W_IsLumpWad(lastloadedmaplumpnum)) // welp it's a map wad in a pk3
|
||||
{ // HACK: Open wad file rather quickly so we can use the things lump
|
||||
|
@ -2470,6 +2471,9 @@ void P_LoadThingsOnly(void)
|
|||
}
|
||||
else // phew it's just a WAD
|
||||
P_PrepareThings(lastloadedmaplumpnum + ML_THINGS);
|
||||
|
||||
memset(localaiming, 0, sizeof(localaiming));
|
||||
|
||||
P_LoadThings();
|
||||
|
||||
P_SpawnSecretItems(true);
|
||||
|
@ -2801,12 +2805,39 @@ static boolean P_CanSave(void)
|
|||
#endif
|
||||
}
|
||||
|
||||
static void P_InitCamera(void)
|
||||
{
|
||||
INT32 i;
|
||||
|
||||
if (!dedicated)
|
||||
{
|
||||
if (!demo.freecam)
|
||||
for (i = 0; i <= splitscreen; i++)
|
||||
P_SetupCamera(displayplayers[i], &camera[i]);
|
||||
|
||||
// Though, I don't think anyone would care about cam_rotate being reset back to the only value that makes sense :P
|
||||
if (!cv_cam_rotate.changed)
|
||||
CV_Set(&cv_cam_rotate, cv_cam_rotate.defaultvalue);
|
||||
|
||||
if (!cv_cam2_rotate.changed)
|
||||
CV_Set(&cv_cam2_rotate, cv_cam2_rotate.defaultvalue);
|
||||
|
||||
if (!cv_cam3_rotate.changed)
|
||||
CV_Set(&cv_cam3_rotate, cv_cam3_rotate.defaultvalue);
|
||||
|
||||
if (!cv_cam4_rotate.changed)
|
||||
CV_Set(&cv_cam4_rotate, cv_cam4_rotate.defaultvalue);
|
||||
|
||||
displayplayers[0] = consoleplayer; // Start with your OWN view, please!
|
||||
}
|
||||
}
|
||||
|
||||
/** Loads a level from a lump or external wad.
|
||||
*
|
||||
* \param skipprecip If true, don't spawn precipitation.
|
||||
* \todo Clean up, refactor, split up; get rid of the bloat.
|
||||
*/
|
||||
boolean P_SetupLevel(boolean skipprecip)
|
||||
boolean P_SetupLevel(boolean skipprecip, boolean reloadinggamestate)
|
||||
{
|
||||
// use gamemap to get map number.
|
||||
// 99% of the things already did, so.
|
||||
|
@ -2844,7 +2875,7 @@ boolean P_SetupLevel(boolean skipprecip)
|
|||
if (cv_runscripts.value && mapheaderinfo[gamemap-1]->scriptname[0] != '#')
|
||||
P_RunLevelScript(mapheaderinfo[gamemap-1]->scriptname);
|
||||
|
||||
P_LevelInitStuff();
|
||||
P_LevelInitStuff(reloadinggamestate);
|
||||
|
||||
for (i = 0; i <= splitscreen; i++)
|
||||
postimgtype[i] = postimg_none;
|
||||
|
@ -2857,12 +2888,8 @@ boolean P_SetupLevel(boolean skipprecip)
|
|||
// chasecam off in match, tag, capture the flag
|
||||
chase = true; // srb2kart: always on
|
||||
|
||||
if (!dedicated)
|
||||
if (!dedicated && !reloadinggamestate)
|
||||
{
|
||||
// Salt: CV_ClearChangedFlags() messes with your settings :(
|
||||
/*if (!cv_cam_speed.changed)
|
||||
CV_Set(&cv_cam_speed, cv_cam_speed.defaultvalue);*/
|
||||
|
||||
if (!cv_chasecam.changed)
|
||||
CV_SetValue(&cv_chasecam, chase);
|
||||
|
||||
|
@ -2881,9 +2908,12 @@ boolean P_SetupLevel(boolean skipprecip)
|
|||
// will be set by player think.
|
||||
players[consoleplayer].viewz = 1;
|
||||
|
||||
// Cancel all d_main.c fadeouts (keep fade in though).
|
||||
if (reloadinggamestate)
|
||||
wipegamestate = gamestate; // Don't fade if reloading the gamestate
|
||||
// Encore mode fade to pink to white
|
||||
// This is handled BEFORE sounds are stopped.
|
||||
if (encoremode && !prevencoremode && !demo.rewinding)
|
||||
else if (encoremode && !prevencoremode && !demo.rewinding)
|
||||
{
|
||||
tic_t locstarttime, endtime, nowtime;
|
||||
|
||||
|
@ -2940,15 +2970,16 @@ boolean P_SetupLevel(boolean skipprecip)
|
|||
|
||||
// As oddly named as this is, this handles music only.
|
||||
// We should be fine starting it here.
|
||||
S_Start();
|
||||
if (!reloadinggamestate)
|
||||
S_Start();
|
||||
|
||||
levelfadecol = (encoremode && !ranspecialwipe ? 122 : 120);
|
||||
|
||||
// Let's fade to white here
|
||||
// But only if we didn't do the encore startup wipe
|
||||
if (!ranspecialwipe && !demo.rewinding)
|
||||
if (!ranspecialwipe && !demo.rewinding && !reloadinggamestate)
|
||||
{
|
||||
if(rendermode != render_none)
|
||||
if (rendermode != render_none)
|
||||
{
|
||||
F_WipeStartScreen();
|
||||
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, levelfadecol);
|
||||
|
@ -3282,74 +3313,12 @@ boolean P_SetupLevel(boolean skipprecip)
|
|||
// landing point for netgames.
|
||||
netgameskip:
|
||||
|
||||
if (!dedicated)
|
||||
if (!reloadinggamestate)
|
||||
{
|
||||
if (!demo.freecam)
|
||||
for (i = 0; i <= splitscreen; i++)
|
||||
P_SetupCamera(displayplayers[i], &camera[i]);
|
||||
|
||||
// Salt: CV_ClearChangedFlags() messes with your settings :(
|
||||
/*if (!cv_cam_height.changed)
|
||||
CV_Set(&cv_cam_height, cv_cam_height.defaultvalue);
|
||||
|
||||
if (!cv_cam_dist.changed)
|
||||
CV_Set(&cv_cam_dist, cv_cam_dist.defaultvalue);
|
||||
|
||||
if (!cv_cam2_height.changed)
|
||||
CV_Set(&cv_cam2_height, cv_cam2_height.defaultvalue);
|
||||
|
||||
if (!cv_cam2_dist.changed)
|
||||
CV_Set(&cv_cam2_dist, cv_cam2_dist.defaultvalue);*/
|
||||
|
||||
// Though, I don't think anyone would care about cam_rotate being reset back to the only value that makes sense :P
|
||||
if (!cv_cam_rotate.changed)
|
||||
CV_Set(&cv_cam_rotate, cv_cam_rotate.defaultvalue);
|
||||
|
||||
if (!cv_cam2_rotate.changed)
|
||||
CV_Set(&cv_cam2_rotate, cv_cam2_rotate.defaultvalue);
|
||||
|
||||
if (!cv_cam3_rotate.changed)
|
||||
CV_Set(&cv_cam3_rotate, cv_cam3_rotate.defaultvalue);
|
||||
|
||||
if (!cv_cam4_rotate.changed)
|
||||
CV_Set(&cv_cam4_rotate, cv_cam4_rotate.defaultvalue);
|
||||
|
||||
/*if (!cv_analog.changed)
|
||||
CV_SetValue(&cv_analog, 0);
|
||||
if (!cv_analog2.changed)
|
||||
CV_SetValue(&cv_analog2, 0);
|
||||
if (!cv_analog3.changed)
|
||||
CV_SetValue(&cv_analog3, 0);
|
||||
if (!cv_analog4.changed)
|
||||
CV_SetValue(&cv_analog4, 0);*/
|
||||
|
||||
// Shouldn't be necessary with render parity?
|
||||
/*if (rendermode != render_none)
|
||||
CV_Set(&cv_fov, cv_fov.defaultvalue);*/
|
||||
|
||||
displayplayers[0] = consoleplayer; // Start with your OWN view, please!
|
||||
P_InitCamera();
|
||||
memset(localaiming, 0, sizeof(localaiming));
|
||||
}
|
||||
|
||||
/*if (cv_useranalog.value)
|
||||
CV_SetValue(&cv_analog, true);
|
||||
|
||||
if ((splitscreen && cv_useranalog2.value) || botingame)
|
||||
CV_SetValue(&cv_analog2, true);
|
||||
|
||||
if (splitscreen > 1 && cv_useranalog3.value)
|
||||
CV_SetValue(&cv_analog3, true);
|
||||
|
||||
if (splitscreen > 2 && cv_useranalog4.value)
|
||||
CV_SetValue(&cv_analog4, true);
|
||||
|
||||
if (twodlevel)
|
||||
{
|
||||
CV_SetValue(&cv_analog4, false);
|
||||
CV_SetValue(&cv_analog3, false);
|
||||
CV_SetValue(&cv_analog2, false);
|
||||
CV_SetValue(&cv_analog, false);
|
||||
}*/
|
||||
|
||||
// clear special respawning que
|
||||
iquehead = iquetail = 0;
|
||||
|
||||
|
@ -3367,7 +3336,7 @@ boolean P_SetupLevel(boolean skipprecip)
|
|||
P_MapEnd();
|
||||
|
||||
// Remove the loading shit from the screen
|
||||
if (rendermode != render_none)
|
||||
if (rendermode != render_none && !reloadinggamestate)
|
||||
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, levelfadecol);
|
||||
|
||||
if (precache || dedicated)
|
||||
|
|
|
@ -59,7 +59,7 @@ void P_SetupLevelSky(INT32 skynum, boolean global);
|
|||
void P_ScanThings(INT16 mapnum, INT16 wadnum, INT16 lumpnum);
|
||||
#endif
|
||||
void P_LoadThingsOnly(void);
|
||||
boolean P_SetupLevel(boolean skipprecip);
|
||||
boolean P_SetupLevel(boolean skipprecip, boolean reloadinggamestate);
|
||||
boolean P_AddWadFile(const char *wadfilename);
|
||||
#ifdef DELFILE
|
||||
boolean P_DelWadFile(void);
|
||||
|
|
Loading…
Reference in a new issue