From 242147e667e92696d0e9c92295bc875fb2ef2376 Mon Sep 17 00:00:00 2001 From: cypress Date: Sat, 29 Jun 2024 18:13:50 -0700 Subject: [PATCH] NX/VITA: nzp_lockviewmodel builtin --- source/cl_parse.c | 5 +++++ source/pr_cmds.c | 28 ++++++++++++++++++++++++++++ source/protocol.h | 1 + 3 files changed, 34 insertions(+) diff --git a/source/cl_parse.c b/source/cl_parse.c index 05563dc..0a62bfd 100644 --- a/source/cl_parse.c +++ b/source/cl_parse.c @@ -1612,6 +1612,11 @@ void CL_ParseServerMessage (void) doubletap_has_damage_buff = MSG_ReadByte(); break; + case svc_lockviewmodel: + // This platform doesn't use this. + MSG_ReadByte(); + break; + case svc_screenflash: screenflash_color = MSG_ReadByte(); screenflash_duration = sv.time + MSG_ReadByte(); diff --git a/source/pr_cmds.c b/source/pr_cmds.c index 24cc4b1..7df8c18 100644 --- a/source/pr_cmds.c +++ b/source/pr_cmds.c @@ -1368,6 +1368,33 @@ void PF_ScreenFlash(void) } } +/* +================= +PF_LockViewmodel + +Server tells client to lock their +viewmodel in place, if applicable. + +nzp_lockviewmodel() +================= +*/ +void PF_LockViewmodel(void) +{ + client_t *client; + int entnum; + int state; + + entnum = G_EDICTNUM(OFS_PARM0); + state = G_FLOAT(OFS_PARM1); + + if (entnum < 1 || entnum > svs.maxclients) + return; + + client = &svs.clients[entnum-1]; + MSG_WriteByte (&client->message, svc_lockviewmodel); + MSG_WriteByte (&client->message, state); +} + /* ================= PF_BettyPrompt @@ -4005,6 +4032,7 @@ static builtin_t pr_builtin[] = PF_SetPlayerName, // #505 PF_SetDoubleTapVersion, // #506 PF_ScreenFlash, // #507 + PF_LockViewmodel, // #508 }; builtin_t *pr_builtins = pr_builtin; diff --git a/source/protocol.h b/source/protocol.h index 45b21f4..03bde61 100644 --- a/source/protocol.h +++ b/source/protocol.h @@ -227,6 +227,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define svc_updatekills 53 // [string] to put in center of the screen #define svc_screenflash 54 // [byte] color [byte] duration [byte] type +#define svc_lockviewmodel 55 // // client to server