Try fixing te_gunshot with nq protocols.

This commit is contained in:
Shpoike 2023-04-11 09:02:35 +01:00
parent 5082928f36
commit d37b8d07ff
4 changed files with 32 additions and 28 deletions

View file

@ -203,6 +203,7 @@ unsigned int Net_PextMask(unsigned int protover, qboolean fornq)
#ifdef PEXT_Q3BSP
PEXT_Q3BSP |
#endif
PEXT_TE_BULLET | //qw's gunshot+explosions etc.
PEXT_FLOATCOORDS | PEXT_HLBSP;
//these all depend fully upon the player/entity deltas, and don't make sense for NQ. Implement PEXT2_REPLACEMENTDELTAS instead.

View file

@ -6081,7 +6081,10 @@ void SV_point_tempentity (vec3_t o, int type, int count) //count (usually 1) is
#endif
break;
case TEQW_NQGUNSHOT:
qwtype[0] = TEQW_NQGUNSHOT;
#ifdef NQPROT
nqtype[0] = TENQ_NQGUNSHOT;
nqtype[1] = TENQ_NQGUNSHOT;
#endif
qwtype[1] = TEQW_QWGUNSHOT;
split = PEXT_TE_BULLET;
break;
@ -6138,8 +6141,9 @@ void SV_point_tempentity (vec3_t o, int type, int count) //count (usually 1) is
}
else if (nqtype[i] >= 0)
{
int nqcount = min(3,count);
do
//messy - TENQ_NQGUNSHOT loops until we reach our counter. should probably randomize positions a little
int nqcount = (nqtype[i] == TENQ_NQGUNSHOT)?min(3,count):1;
while(nqcount-->0)
{
MSG_WriteByte (&sv.nqmulticast, svc_temp_entity);
MSG_WriteByte (&sv.nqmulticast, nqtype[i]);
@ -6149,19 +6153,12 @@ void SV_point_tempentity (vec3_t o, int type, int count) //count (usually 1) is
MSG_WriteChar(&sv.nqmulticast, 0);
MSG_WriteChar(&sv.nqmulticast, 0);
}
else if (/*nqtype == TENQ_QWBLOOD ||*/ nqtype[i] == TENQ_QWGUNSHOT)
else if (nqtype[i] == TENQ_QWGUNSHOT)
MSG_WriteByte (&sv.nqmulticast, count);
MSG_WriteCoord (&sv.nqmulticast, o[0]);
MSG_WriteCoord (&sv.nqmulticast, o[1]);
MSG_WriteCoord (&sv.nqmulticast, o[2]);
//messy - TENQ_NQGUNSHOT looks until we reach our counter. should probably randomize positions a little
if (nqcount > 1 && nqtype[i] == TENQ_NQGUNSHOT)
{
nqcount--;
continue;
}
} while(0);
}
}
#endif
if (i)

View file

@ -713,7 +713,7 @@ void SV_MulticastProtExt(vec3_t origin, multicast_t to, int dimension_mask, int
for (split = client, seat = 0; split; split = split->controlled, seat++)
{
if (split->protocol == SCP_QUAKEWORLD)
//if (split->protocol == SCP_QUAKEWORLD)
{
if (split->fteprotocolextensions & without)
{

View file

@ -235,14 +235,19 @@ void(float damage, vector dir) TraceAttack =
}
else
{
WriteByte (MSG_BROADCAST, SVC_TEMPENTITY);
WriteByte (MSG_BROADCAST, TE_GUNSHOT);
if (checkbuiltin(te_gunshot))
te_gunshot(org);
else
{
WriteByte (MSG_BROADCAST, SVC_TEMPENTITY);
WriteByte (MSG_BROADCAST, TE_GUNSHOT);
#ifdef QWSSQC
WriteByte (MSG_BROADCAST, 1); //count
WriteByte (MSG_BROADCAST, 1); //count
#endif
WriteCoord (MSG_BROADCAST, org_x);
WriteCoord (MSG_BROADCAST, org_y);
WriteCoord (MSG_BROADCAST, org_z);
WriteCoord (MSG_BROADCAST, org_x);
WriteCoord (MSG_BROADCAST, org_y);
WriteCoord (MSG_BROADCAST, org_z);
}
}
};
@ -399,15 +404,16 @@ void() BecomeExplosion =
self.dimension_seen = DIMENSION_NOCSQC;
dimension_send = DIMENSION_NOCSQC;
#if 1
WriteByte (MSG_BROADCAST, SVC_TEMPENTITY);
WriteByte (MSG_BROADCAST, TE_EXPLOSION);
WriteCoord (MSG_BROADCAST, self.origin_x);
WriteCoord (MSG_BROADCAST, self.origin_y);
WriteCoord (MSG_BROADCAST, self.origin_z);
#else
te_explosion(self.origin);
#endif
if (checkbuiltin(te_explosion))
te_explosion(self.origin);
else
{
WriteByte (MSG_BROADCAST, SVC_TEMPENTITY);
WriteByte (MSG_BROADCAST, TE_EXPLOSION);
WriteCoord (MSG_BROADCAST, self.origin_x);
WriteCoord (MSG_BROADCAST, self.origin_y);
WriteCoord (MSG_BROADCAST, self.origin_z);
}
sound (self, CHAN_WEAPON, "weapons/r_exp3.wav", 1, ATTN_NORM);
self.dimension_seen = DIMENSION_DEFAULT;