diff --git a/src/client/cl_entities.c b/src/client/cl_entities.c index db847908..80d2894f 100644 --- a/src/client/cl_entities.c +++ b/src/client/cl_entities.c @@ -40,7 +40,6 @@ CL_AddPacketEntities(frame_t *frame) centity_t *cent; int autoanim; clientinfo_t *ci; - unsigned int effects, renderfx; /* To distinguish baseq2, xatrix and rogue. */ cvar_t *gametype = Cvar_Get("gametype", "", CVAR_LATCH | CVAR_SERVERINFO); @@ -53,12 +52,15 @@ CL_AddPacketEntities(frame_t *frame) for (pnum = 0; pnum < frame->num_entities; pnum++) { + unsigned int effects, renderfx, rr_effects; + s1 = &cl_parse_entities[(frame->parse_entities + pnum) & (MAX_PARSE_ENTITIES - 1)]; cent = &cl_entities[s1->number]; effects = s1->effects; + rr_effects = s1->rr_effects; renderfx = s1->renderfx; /* set frame */ @@ -132,7 +134,7 @@ CL_AddPacketEntities(frame_t *frame) for (i = 0; i < 3; i++) { ent.origin[i] = ent.oldorigin[i] = cent->prev.origin[i] + cl.lerpfrac * - (cent->current.origin[i] - cent->prev.origin[i]); + (cent->current.origin[i] - cent->prev.origin[i]); } } @@ -254,7 +256,7 @@ CL_AddPacketEntities(frame_t *frame) } } - if (effects & EF_FLASHLIGHT) { + if (rr_effects & EF_FLASHLIGHT) { vec3_t forward, start, end; trace_t trace; int mask = CONTENTS_SOLID | CONTENTS_MONSTER; diff --git a/src/client/cl_parse.c b/src/client/cl_parse.c index 119e00fe..f40cebd8 100644 --- a/src/client/cl_parse.c +++ b/src/client/cl_parse.c @@ -254,6 +254,27 @@ CL_ParseDelta(entity_state_t *from, entity_state_t *to, int number, int bits) to->effects = MSG_ReadShort(&net_message); } + /* ReRelease effects */ + if (cls.serverProtocol != PROTOCOL_VERSION) + { + to->rr_effects = 0; + } + else + { + if ((bits & (U_EFFECTS8 | U_EFFECTS16)) == (U_EFFECTS8 | U_EFFECTS16)) + { + to->rr_effects = MSG_ReadLong(&net_message); + } + else if (bits & U_EFFECTS8) + { + to->rr_effects = MSG_ReadByte(&net_message); + } + else if (bits & U_EFFECTS16) + { + to->rr_effects = MSG_ReadShort(&net_message); + } + } + if ((bits & (U_RENDERFX8 | U_RENDERFX16)) == (U_RENDERFX8 | U_RENDERFX16)) { to->renderfx = MSG_ReadLong(&net_message); diff --git a/src/common/header/shared.h b/src/common/header/shared.h index 2ddffff2..4233a79a 100644 --- a/src/common/header/shared.h +++ b/src/common/header/shared.h @@ -692,7 +692,6 @@ typedef struct * it has a zero index model. */ #define EF_ROTATE 0x00000001 /* rotate (bonus items) */ #define EF_GIB 0x00000002 /* leave a trail */ -#define EF_FLASHLIGHT 0x00000004 /* project flashlight, only for players */ #define EF_BLASTER 0x00000008 /* redlight + trail */ #define EF_ROCKET 0x00000010 /* redlight + trail */ #define EF_GRENADE 0x00000020 @@ -723,6 +722,10 @@ typedef struct #define EF_HALF_DAMAGE 0x40000000 #define EF_TRACKERTRAIL 0x80000000 +/* entity_state_t->rr_effects + * ReRelease flags, values are diffeent to quake 2 RR code */ +#define EF_FLASHLIGHT 0x00000001 /* project flashlight, only for players */ + /* entity_state_t->renderfx flags */ #define RF_MINLIGHT 1 /* allways have some light (viewmodel) */ #define RF_VIEWERMODEL 2 /* don't draw through eyes, only mirrors */ @@ -1224,7 +1227,8 @@ typedef struct entity_state_s /* events only go out for a single frame, they */ /* are automatically cleared each frame */ /* New protocol fields */ - vec3_t scale; + vec3_t scale; /* model scale */ + unsigned int rr_effects; } entity_state_t; /* ============================================== */ diff --git a/src/common/movemsg.c b/src/common/movemsg.c index fc2e4fe3..cc573575 100644 --- a/src/common/movemsg.c +++ b/src/common/movemsg.c @@ -527,14 +527,14 @@ MSG_WriteDeltaEntity(entity_state_t *from, } } - if (to->effects != from->effects) + if ((to->effects != from->effects) || (to->rr_effects != from->rr_effects)) { - if (to->effects < 256) + if ((to->effects < 256) && (to->rr_effects < 256)) { bits |= U_EFFECTS8; } - else if (to->effects < 0x8000) + else if ((to->effects < 0x8000) && (to->rr_effects < 0x8000)) { bits |= U_EFFECTS16; } @@ -767,6 +767,25 @@ MSG_WriteDeltaEntity(entity_state_t *from, MSG_WriteShort(msg, to->effects); } + /* ReRelease effects */ + if (protocol == PROTOCOL_VERSION) + { + if ((bits & (U_EFFECTS8 | U_EFFECTS16)) == (U_EFFECTS8 | U_EFFECTS16)) + { + MSG_WriteLong(msg, to->rr_effects); + } + + else if (bits & U_EFFECTS8) + { + MSG_WriteByte(msg, to->rr_effects); + } + + else if (bits & U_EFFECTS16) + { + MSG_WriteShort(msg, to->rr_effects); + } + } + if ((bits & (U_RENDERFX8 | U_RENDERFX16)) == (U_RENDERFX8 | U_RENDERFX16)) { MSG_WriteLong(msg, to->renderfx); diff --git a/src/game/player/view.c b/src/game/player/view.c index 52b013c1..05675b7a 100644 --- a/src/game/player/view.c +++ b/src/game/player/view.c @@ -1114,6 +1114,7 @@ G_SetClientEffects(edict_t *ent) } ent->s.effects = 0; + ent->s.rr_effects = 0; /* player is always ir visible, even dead. */ ent->s.renderfx = RF_IR_VISIBLE; @@ -1125,7 +1126,7 @@ G_SetClientEffects(edict_t *ent) if (ent->flags & FL_FLASHLIGHT) { - ent->s.effects |= EF_FLASHLIGHT; + ent->s.rr_effects |= EF_FLASHLIGHT; } if (ent->flags & FL_DISGUISED)