NX/VITA: nzp_lockviewmodel builtin

This commit is contained in:
cypress 2024-06-29 18:13:50 -07:00
parent 4fa92811be
commit 242147e667
3 changed files with 34 additions and 0 deletions

View File

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

View File

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

View File

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