nzp_lockviewmodel implementation

This commit is contained in:
cypress 2024-06-29 18:10:58 -07:00
parent 8bc298bfb6
commit b1018b3f64
3 changed files with 35 additions and 1 deletions

View file

@ -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();

View file

@ -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

View file

@ -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