protocol: partial support of 29.3 player coordinates

Changed only protocol without internal variables changes
This commit is contained in:
Denis Pauk 2025-01-01 22:46:19 +02:00
parent 33fd4579fb
commit 9e3de04388
3 changed files with 30 additions and 12 deletions

View file

@ -160,7 +160,7 @@ Goals, fully finished goals could be checked in [here](CHANGELOG):
* [ ] Support textures/*/*_glow.png load from ReRelease,
* [ ] Support tactile/*/*.bnvib/.wav feedback load from ReRelease,
* [ ] Fix physics with incorrect floor height in psx/base0.bsp,
* [ ] Make pmove_state_t.origin 29.3 (PS_M_ORIGIN),
* [ ] Make pmove_state_t.origin 29.3 (PS_M_ORIGIN) >4k coord values support,
* [ ] Fix statusbar for DoD `roarke`,
* [ ] Group `it_pic` images in vulkan render,
* [ ] Rearange surfaces in vulkan render before render,

View file

@ -595,7 +595,7 @@ CL_ParsePacketEntities(frame_t *oldframe, frame_t *newframe)
}
static void
CL_ParsePlayerstate(frame_t *oldframe, frame_t *newframe)
CL_ParsePlayerstate(frame_t *oldframe, frame_t *newframe, int protocol)
{
int flags, i, statbits;
player_state_t *state;
@ -623,9 +623,18 @@ CL_ParsePlayerstate(frame_t *oldframe, frame_t *newframe)
if (flags & PS_M_ORIGIN)
{
state->pmove.origin[0] = MSG_ReadShort(&net_message);
state->pmove.origin[1] = MSG_ReadShort(&net_message);
state->pmove.origin[2] = MSG_ReadShort(&net_message);
if (IS_QII97_PROTOCOL(protocol))
{
state->pmove.origin[0] = MSG_ReadShort(&net_message);
state->pmove.origin[1] = MSG_ReadShort(&net_message);
state->pmove.origin[2] = MSG_ReadShort(&net_message);
}
else
{
state->pmove.origin[0] = MSG_ReadLong(&net_message);
state->pmove.origin[1] = MSG_ReadLong(&net_message);
state->pmove.origin[2] = MSG_ReadLong(&net_message);
}
}
if (flags & PS_M_VELOCITY)
@ -686,7 +695,7 @@ CL_ParsePlayerstate(frame_t *oldframe, frame_t *newframe)
if (flags & PS_WEAPONINDEX)
{
if (IS_QII97_PROTOCOL(cls.serverProtocol))
if (IS_QII97_PROTOCOL(protocol))
{
state->gunindex = MSG_ReadByte(&net_message);
}
@ -698,7 +707,7 @@ CL_ParsePlayerstate(frame_t *oldframe, frame_t *newframe)
if (flags & PS_WEAPONFRAME)
{
if (IS_QII97_PROTOCOL(cls.serverProtocol))
if (IS_QII97_PROTOCOL(protocol))
{
state->gunframe = MSG_ReadByte(&net_message);
}
@ -745,7 +754,7 @@ CL_ParsePlayerstate(frame_t *oldframe, frame_t *newframe)
if (i == STAT_PICKUP_STRING)
{
state->stats[i] = P_ConvertConfigStringFrom(state->stats[i],
cls.serverProtocol);
protocol);
}
}
}
@ -871,7 +880,7 @@ CL_ParseFrame(void)
Com_Error(ERR_DROP, "CL_ParseFrame: 0x%X not playerinfo", cmd);
}
CL_ParsePlayerstate(old, &cl.frame);
CL_ParsePlayerstate(old, &cl.frame, cls.serverProtocol);
/* read packet entities */
cmd = MSG_ReadByte(&net_message);

View file

@ -281,9 +281,18 @@ SV_WritePlayerstateToClient(client_frame_t *from, client_frame_t *to,
if (pflags & PS_M_ORIGIN)
{
MSG_WriteShort(msg, ps->pmove.origin[0]);
MSG_WriteShort(msg, ps->pmove.origin[1]);
MSG_WriteShort(msg, ps->pmove.origin[2]);
if (IS_QII97_PROTOCOL(protocol))
{
MSG_WriteShort(msg, ps->pmove.origin[0]);
MSG_WriteShort(msg, ps->pmove.origin[1]);
MSG_WriteShort(msg, ps->pmove.origin[2]);
}
else
{
MSG_WriteLong(msg, ps->pmove.origin[0]);
MSG_WriteLong(msg, ps->pmove.origin[1]);
MSG_WriteLong(msg, ps->pmove.origin[2]);
}
}
if (pflags & PS_M_VELOCITY)