X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=protocol.c;h=f3882c4f275fa30898ea3a9240bf11c379c70680;hb=10523a94c80615aeccfa84c81bbffe11335ca4a7;hp=ad544396422081f03827e5000eb965c9ace2f655;hpb=69a9f6bb4ea7d2a62b22238da58fe99d0ebd41d8;p=xonotic%2Fdarkplaces.git diff --git a/protocol.c b/protocol.c index ad544396..f3882c4f 100644 --- a/protocol.c +++ b/protocol.c @@ -194,11 +194,11 @@ void EntityFrameQuake_ReadEntity(int bits) if (cls.protocol == PROTOCOL_NEHAHRAMOVIE && (bits & U_EXTEND1)) { // LordHavoc: evil format - int i = MSG_ReadFloat(); - int j = MSG_ReadFloat() * 255.0f; + int i = (int)MSG_ReadFloat(); + int j = (int)(MSG_ReadFloat() * 255.0f); if (i == 2) { - i = MSG_ReadFloat(); + i = (int)MSG_ReadFloat(); if (i) s.effects |= EF_FULLBRIGHT; } @@ -268,7 +268,7 @@ void EntityFrameCSQC_InitClientVersions (int client, qboolean clear) Mem_Free(sv2csqcents_version[client]); sv2csqcents_version[client] = NULL; } - sv2csqcents_version[client] = Mem_Alloc(sv2csqc, MAX_EDICTS); + sv2csqcents_version[client] = (unsigned char *)Mem_Alloc(sv2csqc, MAX_EDICTS); memset(sv2csqcents_version[client], 0, MAX_EDICTS); } @@ -2470,6 +2470,9 @@ void EntityStateQW_ReadPlayerUpdate(void) // if this is an update on our player, update interpolation state if (enumber == cl.playerentity) { + // force a recalculation of the player prediction + cl.movement_replay = true; + VectorCopy (cl.mpunchangle[0], cl.mpunchangle[1]); VectorCopy (cl.mpunchvector[0], cl.mpunchvector[1]); VectorCopy (cl.mvelocity[0], cl.mvelocity[1]); @@ -2597,7 +2600,13 @@ void EntityFrameQW_CL_ReadFrame(qboolean delta) cl.entitydatabaseqw = EntityFrameQW_AllocDatabase(cls.levelmempool); d = cl.entitydatabaseqw; - newsnapindex = cls.netcon->qw.incoming_sequence & QW_UPDATE_MASK; + // there is no cls.netcon in demos, so this reading code can't access + // cls.netcon-> at all... so cls.qw_incoming_sequence and + // cls.qw_outgoing_sequence are updated every time the corresponding + // cls.netcon->qw. variables are updated + // read the number of this frame to echo back in next input packet + cl.qw_validsequence = cls.qw_incoming_sequence; + newsnapindex = cl.qw_validsequence & QW_UPDATE_MASK; newsnap = d->snapshot + newsnapindex; memset(newsnap, 0, sizeof(*newsnap)); oldsnapindex = -1; @@ -2610,7 +2619,7 @@ void EntityFrameQW_CL_ReadFrame(qboolean delta) Con_DPrintf("WARNING: from mismatch\n"); if (oldsnapindex != -1) { - if (cls.netcon->qw.outgoing_sequence - oldsnapindex >= QW_UPDATE_BACKUP-1) + if (cls.qw_outgoing_sequence - oldsnapindex >= QW_UPDATE_BACKUP-1) { Con_DPrintf("delta update too old\n"); newsnap->invalid = invalid = true; // too old @@ -2622,8 +2631,7 @@ void EntityFrameQW_CL_ReadFrame(qboolean delta) delta = false; } - // read the number of this frame to echo back in next input packet - cl.qw_validsequence = cls.netcon->qw.incoming_sequence; + // if we can't decode this frame properly, report that to the server if (invalid) cl.qw_validsequence = 0;