Whitespace, and fixes for SV_EmitNailUpdate.

This commit is contained in:
Ragnvald Maartmann-Moe IV 2002-06-28 02:11:13 +00:00
parent 536937b2e6
commit 1555324e0d

View file

@ -114,7 +114,8 @@ qboolean
SV_AddNailUpdate (edict_t *ent)
{
if (SVfloat (ent, modelindex) != sv_nailmodel
&& SVfloat (ent, modelindex) != sv_supernailmodel) return false;
&& SVfloat (ent, modelindex) != sv_supernailmodel)
return false;
if (numnails == MAX_NAILS)
return true;
nails[numnails] = ent;
@ -137,11 +138,11 @@ SV_EmitNailUpdate (sizebuf_t *msg)
for (n = 0; n < numnails; n++) {
ent = nails[n];
x = (int) (SVvector (ent, origin)[0] + 4096) >> 1;
y = (int) (SVvector (ent, origin)[1] + 4096) >> 1;
z = (int) (SVvector (ent, origin)[2] + 4096) >> 1;
p = (int) (16 * SVvector (ent, angles)[0] / 360) & 15;
yaw = (int) (256 * SVvector (ent, angles)[1] / 360) & 255;
x = ((int) (SVvector (ent, origin)[0] + 4096 + 1) >> 1) & 4095;
y = ((int) (SVvector (ent, origin)[1] + 4096 + 1) >> 1) & 4095;
z = ((int) (SVvector (ent, origin)[2] + 4096 + 1) >> 1) & 4095;
p = (int) (SVvector (ent, angles)[0] * (16.0 / 360.0)) & 15;
yaw = (int) (SVvector (ent, angles)[1] * (256.0 / 360.0)) & 255;
bits[0] = x;
bits[1] = (x >> 8) | (y << 4);
@ -338,8 +339,7 @@ SV_EmitPacketEntities (client_t *client, packet_entities_t *to, sizebuf_t *msg)
// SV_Printf ("---%i to %i ----\n", client->delta_sequence & UPDATE_MASK,
// client->netchan.outgoing_sequence & UPDATE_MASK);
while (newindex < to->num_entities || oldindex < oldmax) {
newnum =
newindex >= to->num_entities ? 9999 :
newnum = newindex >= to->num_entities ? 9999 :
to->entities[newindex].number;
oldnum = oldindex >= oldmax ? 9999 : from->entities[oldindex].number;
@ -573,8 +573,7 @@ SV_WriteEntitiesToClient (client_t *client, sizebuf_t *msg)
num_edicts = min (sv.num_edicts, 512); //FIXME stupid protocol limit
for (e = MAX_CLIENTS + 1, ent = EDICT_NUM (&sv_pr_state, e);
e < num_edicts;
e++, ent = NEXT_EDICT (&sv_pr_state, ent)) {
e < num_edicts; e++, ent = NEXT_EDICT (&sv_pr_state, ent)) {
if (ent->free)
continue;
@ -628,16 +627,14 @@ SV_WriteEntitiesToClient (client_t *client, sizebuf_t *msg)
state->scale = bound (0, SVfloat (ent, scale), 15.9375) * 16.0;
if (sv_fields.glow_size != -1 && SVfloat (ent, glow_size))
state->glow_size = bound (-1024, (int) SVfloat
(ent, glow_size), 1016) >> 3;
state->glow_size =
bound (-1024, (int) SVfloat (ent, glow_size), 1016) >> 3;
if (sv_fields.glow_color != -1 && SVfloat (ent, glow_color))
state->glow_color = (int) SVfloat (ent, glow_color);
if (sv_fields.colormod != -1
&& SVvector (ent, colormod)[0]
&& SVvector (ent, colormod)[1]
&& SVvector (ent, colormod)[2])
if (sv_fields.colormod != -1 && SVvector (ent, colormod)[0]
&& SVvector (ent, colormod)[1] && SVvector (ent, colormod)[2])
state->colormod =
((int) (bound (0, SVvector (ent, colormod)[0], 1) * 7.0)
<< 5) |
@ -650,7 +647,6 @@ SV_WriteEntitiesToClient (client_t *client, sizebuf_t *msg)
// encode the packet entities as a delta from the
// last packetentities acknowledged by the client
SV_EmitPacketEntities (client, pack, msg);
// now add the specialized nail update