mirror of
https://github.com/nzp-team/fteqw.git
synced 2024-11-23 04:11:53 +00:00
Fixes the phantom grenades in twig.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3113 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
a7ee0f883d
commit
4e5e28b1ee
1 changed files with 29 additions and 27 deletions
|
@ -430,21 +430,6 @@ void SV_WriteDelta (entity_state_t *from, entity_state_t *to, sizebuf_t *msg, qb
|
|||
// send an update
|
||||
bits = 0;
|
||||
|
||||
if (to->number >= 512)
|
||||
{
|
||||
if (to->number >= 1024)
|
||||
{
|
||||
if (to->number >= 1024+512)
|
||||
evenmorebits |= U_ENTITYDBL;
|
||||
|
||||
evenmorebits |= U_ENTITYDBL2;
|
||||
if (to->number >= 2048)
|
||||
SV_Error ("Entity number >= 2048");
|
||||
}
|
||||
else
|
||||
evenmorebits |= U_ENTITYDBL;
|
||||
}
|
||||
|
||||
for (i=0 ; i<3 ; i++)
|
||||
{
|
||||
miss = to->origin[i] - from->origin[i];
|
||||
|
@ -527,13 +512,6 @@ void SV_WriteDelta (entity_state_t *from, entity_state_t *to, sizebuf_t *msg, qb
|
|||
|
||||
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;
|
||||
|
||||
if (evenmorebits&0xff00)
|
||||
evenmorebits |= U_YETMORE;
|
||||
if (evenmorebits&0x00ff)
|
||||
bits |= U_EVENMORE;
|
||||
if (bits & 511)
|
||||
bits |= U_MOREBITS;
|
||||
#endif
|
||||
|
||||
if (to->flags & U_SOLID)
|
||||
|
@ -551,8 +529,33 @@ void SV_WriteDelta (entity_state_t *from, entity_state_t *to, sizebuf_t *msg, qb
|
|||
if (!to->number)
|
||||
SV_Error ("Unset entity number");
|
||||
|
||||
if (!bits && !force)
|
||||
if (!bits && !evenmorebits && !force)
|
||||
return; // nothing to send!
|
||||
|
||||
#ifdef PROTOCOLEXTENSIONS
|
||||
if (to->number >= 512)
|
||||
{
|
||||
if (to->number >= 1024)
|
||||
{
|
||||
if (to->number >= 1024+512)
|
||||
evenmorebits |= U_ENTITYDBL;
|
||||
|
||||
evenmorebits |= U_ENTITYDBL2;
|
||||
if (to->number >= 2048)
|
||||
SV_Error ("Entity number >= 2048");
|
||||
}
|
||||
else
|
||||
evenmorebits |= U_ENTITYDBL;
|
||||
}
|
||||
|
||||
if (evenmorebits&0xff00)
|
||||
evenmorebits |= U_YETMORE;
|
||||
if (evenmorebits&0x00ff)
|
||||
bits |= U_EVENMORE;
|
||||
if (bits & 511)
|
||||
bits |= U_MOREBITS;
|
||||
#endif
|
||||
|
||||
i = (to->number&511) | (bits&~511);
|
||||
if (i & U_REMOVE)
|
||||
Sys_Error ("U_REMOVE");
|
||||
|
@ -711,7 +714,7 @@ void SV_EmitPacketEntities (client_t *client, packet_entities_t *to, sizebuf_t *
|
|||
if (newnum > oldnum)
|
||||
{ // the old entity isn't present in the new message
|
||||
//Con_Printf ("remove %i\n", oldnum);
|
||||
if (oldnum > 512)
|
||||
if (oldnum >= 512)
|
||||
{
|
||||
//yup, this is expensive.
|
||||
MSG_WriteShort (msg, oldnum | U_REMOVE|U_MOREBITS);
|
||||
|
@ -719,9 +722,9 @@ void SV_EmitPacketEntities (client_t *client, packet_entities_t *to, sizebuf_t *
|
|||
if (oldnum >= 1024)
|
||||
{
|
||||
if (oldnum >= 1024+512)
|
||||
MSG_WriteByte (msg, U_ENTITYDBL2);
|
||||
else
|
||||
MSG_WriteByte (msg, U_ENTITYDBL|U_ENTITYDBL2);
|
||||
else
|
||||
MSG_WriteByte (msg, U_ENTITYDBL2);
|
||||
}
|
||||
else
|
||||
MSG_WriteByte (msg, U_ENTITYDBL);
|
||||
|
@ -1044,7 +1047,6 @@ void SVDP_EmitEntitiesUpdate (client_t *client, packet_entities_t *to, sizebuf_t
|
|||
|
||||
if (newnum > oldnum)
|
||||
{ // the old entity isn't present in the new message
|
||||
Con_Printf ("remove %i\n", oldnum);
|
||||
MSG_WriteShort(msg, oldnum | 0x8000);
|
||||
oldindex++;
|
||||
continue;
|
||||
|
|
Loading…
Reference in a new issue