protocol: partial revert f856be35

protocol changes broke backward compatibility, temporary disable
This commit is contained in:
Denis Pauk 2024-12-08 00:39:54 +02:00
parent b95ce55edc
commit d4b4266758
10 changed files with 53 additions and 16 deletions

View file

@ -61,7 +61,11 @@ CL_AddPacketEntities(frame_t *frame)
cent = &cl_entities[s1->number];
effects = s1->effects;
#if _RREXTEND
rr_effects = s1->rr_effects;
#else
rr_effects = 0;
#endif
renderfx = s1->renderfx;
/* set frame */
@ -208,7 +212,11 @@ CL_AddPacketEntities(frame_t *frame)
}
/* store scale */
#if _RREXTEND
VectorCopy(s1->scale, ent.scale);
#else
VectorClear(ent.scale);
#endif
}
/* only used for black hole model right now */

View file

@ -143,6 +143,7 @@ CL_ParseDelta(entity_state_t *from, entity_state_t *to, int number, int bits)
VectorCopy(from->origin, to->old_origin);
to->number = number;
#if _RREXTEND
if (cls.serverProtocol != PROTOCOL_VERSION)
{
int i;
@ -153,6 +154,7 @@ CL_ParseDelta(entity_state_t *from, entity_state_t *to, int number, int bits)
to->scale[i] = 1.0f;
}
}
#endif
if (IS_QII97_PROTOCOL(cls.serverProtocol))
{
@ -222,6 +224,7 @@ CL_ParseDelta(entity_state_t *from, entity_state_t *to, int number, int bits)
{
to->skinnum = MSG_ReadLong(&net_message);
/* Additional scale with skinnum */
#if _RREXTEND
if (cls.serverProtocol == PROTOCOL_VERSION)
{
int i;
@ -231,6 +234,7 @@ CL_ParseDelta(entity_state_t *from, entity_state_t *to, int number, int bits)
to->scale[i] = MSG_ReadFloat(&net_message);
}
}
#endif
}
else if (bits & U_SKIN8)
{
@ -255,6 +259,7 @@ CL_ParseDelta(entity_state_t *from, entity_state_t *to, int number, int bits)
}
/* ReRelease effects */
#if _RREXTEND
if (cls.serverProtocol != PROTOCOL_VERSION)
{
to->rr_effects = 0;
@ -274,6 +279,7 @@ CL_ParseDelta(entity_state_t *from, entity_state_t *to, int number, int bits)
to->rr_effects = MSG_ReadShort(&net_message);
}
}
#endif
if ((bits & (U_RENDERFX8 | U_RENDERFX16)) == (U_RENDERFX8 | U_RENDERFX16))
{

View file

@ -1228,10 +1228,15 @@ typedef struct entity_state_s
int event; /* impulse events -- muzzle flashes, footsteps, etc */
/* events only go out for a single frame, they */
/* are automatically cleared each frame */
} entity_state_t;
/* ReRelease states */
typedef struct entity_rrstate_s
{
/* New protocol fields */
vec3_t scale; /* model scale */
unsigned int rr_effects;
} entity_state_t;
unsigned int effects;
} entity_rrstate_t;
/* ============================================== */

View file

@ -505,6 +505,7 @@ MSG_WriteDeltaEntity(entity_state_t *from,
}
}
#if _RREXTEND
/* Scale with skins if force or different */
if ((protocol == PROTOCOL_VERSION) &&
((to->scale[0] != from->scale[0]) ||
@ -513,6 +514,7 @@ MSG_WriteDeltaEntity(entity_state_t *from,
{
bits |= (U_SKIN8 | U_SKIN16);
}
#endif
if (to->frame != from->frame)
{
@ -527,14 +529,14 @@ MSG_WriteDeltaEntity(entity_state_t *from,
}
}
if ((to->effects != from->effects) || (to->rr_effects != from->rr_effects))
if (to->effects != from->effects)
{
if ((to->effects < 256) && (to->rr_effects < 256))
if (to->effects < 256)
{
bits |= U_EFFECTS8;
}
else if ((to->effects < 0x8000) && (to->rr_effects < 0x8000))
else if (to->effects < 0x8000)
{
bits |= U_EFFECTS16;
}
@ -545,6 +547,13 @@ MSG_WriteDeltaEntity(entity_state_t *from,
}
}
#if _RREXTEND
if (to->rr_effects != from->rr_effects)
{
bits |= U_EFFECTS8 | U_EFFECTS16;
}
#endif
if (to->renderfx != from->renderfx)
{
if (to->renderfx < 256)
@ -730,6 +739,7 @@ MSG_WriteDeltaEntity(entity_state_t *from,
{
MSG_WriteLong(msg, to->skinnum);
#if _RREXTEND
/* Send scale */
if (protocol == PROTOCOL_VERSION)
{
@ -740,6 +750,7 @@ MSG_WriteDeltaEntity(entity_state_t *from,
MSG_WriteFloat(msg, to->scale[i]);
}
}
#endif
}
else if (bits & U_SKIN8)
@ -767,6 +778,7 @@ MSG_WriteDeltaEntity(entity_state_t *from,
MSG_WriteShort(msg, to->effects);
}
#if _RREXTEND
/* ReRelease effects */
if (protocol == PROTOCOL_VERSION)
{
@ -785,6 +797,7 @@ MSG_WriteDeltaEntity(entity_state_t *from,
MSG_WriteShort(msg, to->rr_effects);
}
}
#endif
if ((bits & (U_RENDERFX8 | U_RENDERFX16)) == (U_RENDERFX8 | U_RENDERFX16))
{

View file

@ -3306,7 +3306,7 @@ SP_misc_flare(edict_t* ent)
/* Radius saved to scale */
for (i = 0; i < 3; i++)
{
ent->s.scale[i] = st.radius;
ent->rrs.scale[i] = st.radius;
}
if (ent->spawnflags & SPAWNFLAG_FLARE_RED)

View file

@ -1136,13 +1136,13 @@ monster_start(edict_t *self)
for (i = 0; i < 3; i++)
{
if (!self->s.scale[i])
if (!self->rrs.scale[i])
{
/* fix empty scale */
self->s.scale[i] = 1.0f;
self->rrs.scale[i] = 1.0f;
}
scale += self->s.scale[i];
scale += self->rrs.scale[i];
}
scale /= 3;
@ -1158,8 +1158,8 @@ monster_start(edict_t *self)
for (i = 0; i < 3; i++)
{
self->mins[i] *= self->s.scale[i];
self->maxs[i] *= self->s.scale[i];
self->mins[i] *= self->rrs.scale[i];
self->maxs[i] *= self->rrs.scale[i];
}
}

View file

@ -89,7 +89,7 @@ DynamicSpawnSetScale(edict_t *self)
}
/* Copy to entity scale field */
VectorCopy(st.scale, self->s.scale);
VectorCopy(st.scale, self->rrs.scale);
}
static void
@ -142,7 +142,7 @@ DynamicSpawnUpdate(edict_t *self, dynamicentity_t *data)
}
else
{
VectorCopy(data->scale, self->s.scale);
VectorCopy(data->scale, self->rrs.scale);
}
}
@ -344,7 +344,7 @@ ED_CallSpawn(edict_t *ent)
}
else
{
VectorSet(ent->s.scale, 1.0, 1.0, 1.0);
VectorSet(ent->rrs.scale, 1.0, 1.0, 1.0);
}
}

View file

@ -101,6 +101,8 @@ struct edict_s
int clipmask;
edict_t *owner;
/* Additional state from ReRelease */
entity_rrstate_t rrs;
/* the game dll can add anything it wants
after this point in the structure */
};

View file

@ -1351,6 +1351,9 @@ struct edict_s
int clipmask;
edict_t *owner;
/* Additional state from ReRelease */
entity_rrstate_t rrs;
/* DO NOT MODIFY ANYTHING ABOVE THIS, THE SERVER */
/* EXPECTS THE FIELDS IN THAT ORDER! */

View file

@ -1114,7 +1114,7 @@ G_SetClientEffects(edict_t *ent)
}
ent->s.effects = 0;
ent->s.rr_effects = 0;
ent->rrs.effects = 0;
/* player is always ir visible, even dead. */
ent->s.renderfx = RF_IR_VISIBLE;
@ -1126,7 +1126,7 @@ G_SetClientEffects(edict_t *ent)
if (ent->flags & FL_FLASHLIGHT)
{
ent->s.rr_effects |= EF_FLASHLIGHT;
ent->rrs.effects |= EF_FLASHLIGHT;
}
if (ent->flags & FL_DISGUISED)