Fix player colors mysteriously turning red if a resynch occurs outside of CTF/Team Match. Not technically a $$$.sav fix, but still netplay related of course

At least, I assume this is how it's happening for some, I haven't been able to get the full info since WHERE IS EVERYBODY?
This commit is contained in:
Monster Iestyn 2017-01-03 22:43:46 +00:00
parent b768c4b961
commit 4d8ca41e65
2 changed files with 6 additions and 17 deletions

View File

@ -868,12 +868,13 @@ static inline void resynch_write_others(resynchend_pak *rst)
{ {
UINT8 i; UINT8 i;
rst->ingame = rst->ctfteam = 0; rst->ingame = 0;
for (i = 0; i < MAXPLAYERS; ++i) for (i = 0; i < MAXPLAYERS; ++i)
{ {
if (!playeringame[i]) if (!playeringame[i])
{ {
rst->ctfteam[i] = 0;
rst->score[i] = 0; rst->score[i] = 0;
rst->numboxes[i] = 0; rst->numboxes[i] = 0;
rst->totalring[i] = 0; rst->totalring[i] = 0;
@ -883,11 +884,8 @@ static inline void resynch_write_others(resynchend_pak *rst)
} }
if (!players[i].spectator) if (!players[i].spectator)
{
rst->ingame |= (1<<i); rst->ingame |= (1<<i);
if (players[i].ctfteam > 1) rst->ctfteam[i] = (INT32)LONG(players[i].ctfteam);
rst->ctfteam |= (1<<i);
}
rst->score[i] = (UINT32)LONG(players[i].score); rst->score[i] = (UINT32)LONG(players[i].score);
rst->numboxes[i] = SHORT(players[i].numboxes); rst->numboxes[i] = SHORT(players[i].numboxes);
rst->totalring[i] = SHORT(players[i].totalring); rst->totalring[i] = SHORT(players[i].totalring);
@ -904,21 +902,12 @@ static inline void resynch_read_others(resynchend_pak *p)
{ {
UINT8 i; UINT8 i;
UINT32 loc_ingame = (UINT32)LONG(p->ingame); UINT32 loc_ingame = (UINT32)LONG(p->ingame);
UINT32 loc_ctfteam = (UINT32)LONG(p->ctfteam);
for (i = 0; i < MAXPLAYERS; ++i) for (i = 0; i < MAXPLAYERS; ++i)
{ {
// We don't care if they're in the game or not, just write all the data. // We don't care if they're in the game or not, just write all the data.
if (loc_ingame & (1<<i)) players[i].spectator = !(loc_ingame & i<<i);
{ players[i].ctfteam = (INT32)LONG(p->ctfteam[i]); // no, 0 does not mean spectator, at least not in Match
players[i].spectator = false;
players[i].ctfteam = (loc_ctfteam & (1<<i)) ? 2 : 1;
}
else
{
players[i].spectator = true;
players[i].ctfteam = 0;
}
players[i].score = (UINT32)LONG(p->score[i]); players[i].score = (UINT32)LONG(p->score[i]);
players[i].numboxes = SHORT(p->numboxes[i]); players[i].numboxes = SHORT(p->numboxes[i]);
players[i].totalring = SHORT(p->totalring[i]); players[i].totalring = SHORT(p->totalring[i]);

View File

@ -133,7 +133,7 @@ typedef struct
fixed_t flagz[2]; fixed_t flagz[2];
UINT32 ingame; // Spectator bit for each player UINT32 ingame; // Spectator bit for each player
UINT32 ctfteam; // If not spectator, then which team? 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 // Resynch game scores and the like all at once
UINT32 score[MAXPLAYERS]; // Everyone's score UINT32 score[MAXPLAYERS]; // Everyone's score