mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-15 01:01:33 +00:00
Merge branch 'waypoint-bruh' into 'next'
Fix waypoint sequence desyncs See merge request STJr/SRB2!975
This commit is contained in:
commit
82af11d0df
1 changed files with 30 additions and 0 deletions
|
@ -717,6 +717,34 @@ static void P_NetUnArchiveColormaps(void)
|
|||
net_colormaps = NULL;
|
||||
}
|
||||
|
||||
static void P_NetArchiveWaypoints(void)
|
||||
{
|
||||
INT32 i, j;
|
||||
|
||||
for (i = 0; i < NUMWAYPOINTSEQUENCES; i++)
|
||||
{
|
||||
WRITEUINT16(save_p, numwaypoints[i]);
|
||||
for (j = 0; j < numwaypoints[i]; j++)
|
||||
WRITEUINT32(save_p, waypoints[i][j] ? waypoints[i][j]->mobjnum : 0);
|
||||
}
|
||||
}
|
||||
|
||||
static void P_NetUnArchiveWaypoints(void)
|
||||
{
|
||||
INT32 i, j;
|
||||
UINT32 mobjnum;
|
||||
|
||||
for (i = 0; i < NUMWAYPOINTSEQUENCES; i++)
|
||||
{
|
||||
numwaypoints[i] = READUINT16(save_p);
|
||||
for (j = 0; j < numwaypoints[i]; j++)
|
||||
{
|
||||
mobjnum = READUINT32(save_p);
|
||||
waypoints[i][j] = (mobjnum == 0) ? NULL : P_FindNewPosition(mobjnum);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
///
|
||||
/// World Archiving
|
||||
///
|
||||
|
@ -4042,6 +4070,7 @@ void P_SaveNetGame(void)
|
|||
P_NetArchiveThinkers();
|
||||
P_NetArchiveSpecials();
|
||||
P_NetArchiveColormaps();
|
||||
P_NetArchiveWaypoints();
|
||||
}
|
||||
LUA_Archive();
|
||||
|
||||
|
@ -4080,6 +4109,7 @@ boolean P_LoadNetGame(void)
|
|||
P_NetUnArchiveThinkers();
|
||||
P_NetUnArchiveSpecials();
|
||||
P_NetUnArchiveColormaps();
|
||||
P_NetUnArchiveWaypoints();
|
||||
P_RelinkPointers();
|
||||
P_FinishMobjs();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue