Fixes a potential illegible server message.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3976 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2012-02-06 02:06:23 +00:00
parent 855b3ee993
commit 37f494a7c0

View file

@ -500,7 +500,7 @@ void SV_WriteDelta (entity_state_t *from, entity_state_t *to, sizebuf_t *msg, qb
fromeffects = from->effects; //so old clients will see the effects baseline as 0 fromeffects = from->effects; //so old clients will see the effects baseline as 0
if ((to->effects&0x00ff) != (fromeffects&0x00ff)) if ((to->effects&0x00ff) != (fromeffects&0x00ff))
bits |= U_EFFECTS; bits |= U_EFFECTS;
if ((to->effects&0xff00) != (fromeffects&0xff00) && protext & PEXT_DPFLAGS) if ((to->effects&0xff00) != (fromeffects&0xff00) && (protext & PEXT_DPFLAGS))
evenmorebits |= U_EFFECTS16; evenmorebits |= U_EFFECTS16;
if (to->modelindex != from->modelindex) if (to->modelindex != from->modelindex)
@ -521,36 +521,36 @@ void SV_WriteDelta (entity_state_t *from, entity_state_t *to, sizebuf_t *msg, qb
#ifdef PROTOCOLEXTENSIONS #ifdef PROTOCOLEXTENSIONS
#ifdef U_SCALE #ifdef U_SCALE
if ( to->scale != from->scale && protext & PEXT_SCALE) if ( to->scale != from->scale && (protext & PEXT_SCALE))
evenmorebits |= U_SCALE; evenmorebits |= U_SCALE;
#endif #endif
#ifdef U_TRANS #ifdef U_TRANS
if ( to->trans != from->trans && protext & PEXT_TRANS) if ( to->trans != from->trans && (protext & PEXT_TRANS))
evenmorebits |= U_TRANS; evenmorebits |= U_TRANS;
#endif #endif
#ifdef U_FATNESS #ifdef U_FATNESS
if ( to->fatness != from->fatness && protext & PEXT_FATNESS) if ( to->fatness != from->fatness && (protext & PEXT_FATNESS))
evenmorebits |= U_FATNESS; evenmorebits |= U_FATNESS;
#endif #endif
if ( to->hexen2flags != from->hexen2flags && protext & PEXT_HEXEN2) if ( to->hexen2flags != from->hexen2flags && (protext & PEXT_HEXEN2))
evenmorebits |= U_DRAWFLAGS; evenmorebits |= U_DRAWFLAGS;
if ( to->abslight != from->abslight && protext & PEXT_HEXEN2) if ( to->abslight != from->abslight && (protext & PEXT_HEXEN2))
evenmorebits |= U_ABSLIGHT; evenmorebits |= U_ABSLIGHT;
if ((to->colormod[0]!=from->colormod[0]||to->colormod[1]!=from->colormod[1]||to->colormod[2]!=from->colormod[2]) && protext & PEXT_COLOURMOD) if ((to->colormod[0]!=from->colormod[0]||to->colormod[1]!=from->colormod[1]||to->colormod[2]!=from->colormod[2]) && (protext & PEXT_COLOURMOD))
evenmorebits |= U_COLOURMOD; evenmorebits |= U_COLOURMOD;
if (to->glowsize != from->glowsize) if (to->glowsize != from->glowsize)
to->dpflags |= 2; // RENDER_GLOWTRAIL to->dpflags |= 2; // RENDER_GLOWTRAIL
if (to->dpflags != from->dpflags && protext & PEXT_DPFLAGS) if (to->dpflags != from->dpflags && (protext & PEXT_DPFLAGS))
evenmorebits |= U_DPFLAGS; evenmorebits |= U_DPFLAGS;
if ((to->tagentity != from->tagentity || to->tagindex != from->tagindex) && protext & PEXT_DPFLAGS) if ((to->tagentity != from->tagentity || to->tagindex != from->tagindex) && (protext & PEXT_DPFLAGS))
evenmorebits |= U_TAGINFO; evenmorebits |= U_TAGINFO;
if ((to->light[0] != from->light[0] || to->light[1] != from->light[1] || to->light[2] != from->light[2] || to->light[3] != from->light[3] || to->lightstyle != from->lightstyle || to->lightpflags != from->lightstyle) && protext & PEXT_DPFLAGS) if ((to->light[0] != from->light[0] || to->light[1] != from->light[1] || to->light[2] != from->light[2] || to->light[3] != from->light[3] || to->lightstyle != from->lightstyle || to->lightpflags != from->lightstyle) && (protext & PEXT_DPFLAGS))
evenmorebits |= U_LIGHT; evenmorebits |= U_LIGHT;
#endif #endif
@ -763,7 +763,7 @@ void SV_EmitPacketEntities (client_t *client, packet_entities_t *to, sizebuf_t *
if (oldnum >= 512) if (oldnum >= 512)
{ {
//yup, this is expensive. //yup, this is expensive.
MSG_WriteShort (msg, oldnum | U_REMOVE|U_MOREBITS); MSG_WriteShort (msg, (oldnum&511) | U_REMOVE|U_MOREBITS);
MSG_WriteByte (msg, U_EVENMORE); MSG_WriteByte (msg, U_EVENMORE);
if (oldnum >= 1024) if (oldnum >= 1024)
{ {
@ -776,7 +776,7 @@ void SV_EmitPacketEntities (client_t *client, packet_entities_t *to, sizebuf_t *
MSG_WriteByte (msg, U_ENTITYDBL); MSG_WriteByte (msg, U_ENTITYDBL);
} }
else else
MSG_WriteShort (msg, oldnum | U_REMOVE); MSG_WriteShort (msg, (oldnum&511) | U_REMOVE);
oldindex++; oldindex++;
continue; continue;
@ -2245,7 +2245,6 @@ void SV_Snapshot_BuildStateQ1(entity_state_t *state, edict_t *ent, client_t *cli
state->light[2] = ent->xv->color[2]*255; state->light[2] = ent->xv->color[2]*255;
state->light[3] = ent->xv->light_lev; state->light[3] = ent->xv->light_lev;
state->lightstyle = ent->xv->style; state->lightstyle = ent->xv->style;
state->lightstyle = ent->xv->style;
state->lightpflags = ent->xv->pflags; state->lightpflags = ent->xv->pflags;
if ((int)ent->v->flags & FL_CLASS_DEPENDENT && client->playerclass) //hexen2 wierdness. if ((int)ent->v->flags & FL_CLASS_DEPENDENT && client->playerclass) //hexen2 wierdness.