diff --git a/src/client/cl_entities.c b/src/client/cl_entities.c index 2752b738f..c34c4f2bf 100644 --- a/src/client/cl_entities.c +++ b/src/client/cl_entities.c @@ -205,6 +205,9 @@ CL_AddPacketEntities(frame_t *frame) ent.skin = NULL; ent.model = cl.model_draw[s1->modelindex]; } + + /* store scale */ + VectorCopy(s1->scale, ent.scale); } /* only used for black hole model right now */ diff --git a/src/client/cl_parse.c b/src/client/cl_parse.c index 2176de539..1f5ce93b8 100644 --- a/src/client/cl_parse.c +++ b/src/client/cl_parse.c @@ -157,6 +157,17 @@ CL_ParseDelta(entity_state_t *from, entity_state_t *to, int number, int bits) } } + if (cls.serverProtocol != PROTOCOL_VERSION) + { + int i; + + /* Always set scale to 1.0f for old clients */ + for (i = 0; i < 3; i++) + { + to->scale[i] = 1.0f; + } + } + if (IS_QII97_PROTOCOL(cls.serverProtocol)) { if (bits & U_MODEL) @@ -224,6 +235,16 @@ CL_ParseDelta(entity_state_t *from, entity_state_t *to, int number, int bits) if ((bits & U_SKIN8) && (bits & U_SKIN16)) { to->skinnum = MSG_ReadLong(&net_message); + /* Additional scale with skinnum */ + if (cls.serverProtocol == PROTOCOL_VERSION) + { + int i; + + for (i = 0; i < 3; i++) + { + to->scale[i] = MSG_ReadFloat(&net_message); + } + } } else if (bits & U_SKIN8) { diff --git a/src/common/movemsg.c b/src/common/movemsg.c index aee9aee4e..322724349 100644 --- a/src/common/movemsg.c +++ b/src/common/movemsg.c @@ -518,6 +518,15 @@ MSG_WriteDeltaEntity(entity_state_t *from, } } + /* Scale with skins if force or different */ + if ((protocol == PROTOCOL_VERSION) && + ((to->scale[0] != from->scale[0]) || + (to->scale[1] != from->scale[1]) || + (to->scale[2] != from->scale[2]))) + { + bits |= (U_SKIN8 | U_SKIN16); + } + if (to->frame != from->frame) { if (to->frame < 256) @@ -723,6 +732,17 @@ MSG_WriteDeltaEntity(entity_state_t *from, if ((bits & U_SKIN8) && (bits & U_SKIN16)) /*used for laser colors */ { MSG_WriteLong(msg, to->skinnum); + + /* Send scale */ + if (protocol == PROTOCOL_VERSION) + { + int i; + + for (i = 0; i < 3; i++) + { + MSG_WriteFloat(msg, to->scale[i]); + } + } } else if (bits & U_SKIN8)