Non mp stuff fix

This commit is contained in:
nukeykt 2019-07-04 02:43:18 +09:00 committed by Christoph Oelckers
parent 5e182e2962
commit 3ce70b7c3a
5 changed files with 26 additions and 3 deletions

View file

@ -875,7 +875,7 @@ nextdemo_nomenu:
for (TRAVERSE_CONNECT(j))
{
Bmemcpy(&inputfifo[0][j], &recsync[bigi], sizeof(input_t));
Bmemcpy(&inputfifo[movefifoplc&(MOVEFIFOSIZ-1)][j], &recsync[bigi], sizeof(input_t));
bigi++;
ud.reccnt--;
}

View file

@ -1089,8 +1089,28 @@ void Net_GetSyncInfoFromPacket(uint8_t *packbuf, int packbufleng, int *j, int ot
}
}
void Net_ClearFIFO(void)
{
int i = 0;
int quittimer = 0;
syncvaltail = 0L;
syncvaltottail = 0L;
memset(&syncstat, 0, sizeof(syncstat));
memset(&g_szfirstSyncMsg, 0, sizeof(g_szfirstSyncMsg));
g_foundSyncError = 0;
bufferjitter = 1;
mymaxlag = otherminlag = 0;
movefifoplc = movefifosendplc = predictfifoplc = 0;
avgfvel = avgsvel = avgavel = avghorz = avgbits = avgextbits = 0;
for (; i < MAXPLAYERS; i++)
{
Bmemset(&g_player[i].movefifoend, 0, sizeof(g_player[i].movefifoend));
Bmemset(&g_player[i].syncvalhead, 0, sizeof(g_player[i].syncvalhead));
Bmemset(&g_player[i].myminlag, 0, sizeof(g_player[i].myminlag));
}
}
void Net_GetInput(void)
{

View file

@ -216,6 +216,7 @@ void Net_ReceiveDisconnect(ENetEvent *event);
// Packet Handlers
#endif
void Net_ClearFIFO(void);
void Net_GetInput(void);
void Net_GetPackets(void);
#ifndef NETCODE_DISABLE

View file

@ -7998,7 +7998,7 @@ HORIZONLY:;
pPlayer->q16horiz -= fix16_from_int(pPlayer->hard_landing<<4);
}
pPlayer->q16horiz = fix16_clamp(pPlayer->q16horiz + (ud.recstat == 2 && g_demo_legacy && !pPlayer->aim_mode) ? 0 : g_player[playerNum].inputBits->q16horz, F16(HORIZ_MIN), F16(HORIZ_MAX));
pPlayer->q16horiz = fix16_clamp(pPlayer->q16horiz + ((ud.recstat == 2 && g_demo_legacy && !pPlayer->aim_mode) ? 0 : g_player[playerNum].inputBits->q16horz), F16(HORIZ_MIN), F16(HORIZ_MAX));
if (ud.recstat == 2 && g_demo_legacy) centerHoriz = !pPlayer->aim_mode;

View file

@ -2190,6 +2190,8 @@ void G_ResetTimers(uint8_t keepgtics)
void G_ClearFIFO(void)
{
Net_ClearFIFO();
g_emuJumpTics = 0;
clearbufbyte(&localInput, sizeof(input_t), 0L);