diff --git a/source/cl_parse.c b/source/cl_parse.c index 2fc0e0b..873e3ac 100644 --- a/source/cl_parse.c +++ b/source/cl_parse.c @@ -1244,6 +1244,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 d8ea282..8630815 100644 --- a/source/pr_cmds.c +++ b/source/pr_cmds.c @@ -3379,6 +3379,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 @@ -3790,7 +3817,8 @@ ebfs_builtin_t pr_ebfs_builtins[] = { 504, "nzp_bettyprompt", PF_BettyPrompt }, { 505, "nzp_setplayername", PF_SetPlayerName }, { 506, "nzp_setdoubletapver", PF_SetDoubleTapVersion }, - { 507, "nzp_screenflash", PF_ScreenFlash } + { 507, "nzp_screenflash", PF_ScreenFlash }, + { 508, "nzp_lockviewmodel", PF_LockViewmodel } // 2001-11-15 DarkPlaces general builtin functions by Lord Havoc end diff --git a/source/protocol.h b/source/protocol.h index bedc2ca..8e16a38 100644 --- a/source/protocol.h +++ b/source/protocol.h @@ -160,6 +160,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define svc_playername 48 #define svc_doubletap 49 #define svc_screenflash 50 // [byte] color [byte] duration [byte] type +#define svc_lockviewmodel 51 // // client to server