Merge branch 'master' of https://git.magicalgirl.moe/KartKrew/Kart.git into sonicitems

This commit is contained in:
toaster 2018-07-06 20:40:47 +01:00
commit 5c5cbeeea2
3 changed files with 19 additions and 15 deletions

View File

@ -3539,7 +3539,7 @@ static void HandleConnect(SINT8 node)
#ifdef JOININGAME
if (nodewaiting[node])
{
if ((gamestate == GS_LEVEL || gamestate == GS_INTERMISSION || gamestate == GS_VOTING) && newnode)
if (newnode)
{
SV_SendSaveGame(node); // send a complete game state
DEBFILE("send savegame\n");
@ -3752,13 +3752,11 @@ static void HandlePacketFromAwayNode(SINT8 node)
/// \note Wait. What if a Lua script uses some global custom variables synched with the NetVars hook?
/// Shouldn't them be downloaded even at intermission time?
/// Also, according to HandleConnect, the server will send the savegame even during intermission...
if (netbuffer->u.servercfg.gamestate == GS_LEVEL
/*|| netbuffer->u.servercfg.gamestate == GS_INTERMISSION
|| netbuffer->u.servercfg.gamestate == GS_VOTING*/)
cl_mode = CL_DOWNLOADSAVEGAME;
else
/// Sryder 2018-07-05: If we don't want to send the player config another way we need to send the gamestate
/// At almost any gamestate there could be joiners... So just always send gamestate?
cl_mode = CL_DOWNLOADSAVEGAME;
#endif
cl_mode = CL_CONNECTED;
cl_mode = CL_CONNECTED;
break;
}

View File

@ -962,13 +962,16 @@ void LUA_Archive(void)
ArchiveExtVars(&players[i], "player");
}
for (th = thinkercap.next; th != &thinkercap; th = th->next)
if (th->function.acp1 == (actionf_p1)P_MobjThinker)
{
// archive function will determine when to skip mobjs,
// and write mobjnum in otherwise.
ArchiveExtVars(th, "mobj");
}
if (gamestate == GS_LEVEL)
{
for (th = thinkercap.next; th != &thinkercap; th = th->next)
if (th->function.acp1 == (actionf_p1)P_MobjThinker)
{
// archive function will determine when to skip mobjs,
// and write mobjnum in otherwise.
ArchiveExtVars(th, "mobj");
}
}
WRITEUINT32(save_p, UINT32_MAX); // end of mobjs marker, replaces mobjnum.
LUAh_NetArchiveHook(NetArchive); // call the NetArchive hook in archive mode

View File

@ -3194,7 +3194,10 @@ static void P_NetArchiveMisc(void)
WRITEUINT32(save_p, ARCHIVEBLOCK_MISC);
WRITEINT16(save_p, gamemap);
WRITEINT16(save_p, gamestate);
if (gamestate != GS_LEVEL)
WRITEINT16(save_p, GS_WAITINGPLAYERS); // nice hack to put people back into waitingplayers
else
WRITEINT16(save_p, gamestate);
for (i = 0; i < MAXPLAYERS; i++)
pig |= (playeringame[i] != 0)<<i;