Implement 'cleardecals' client command, as well as an SVC_CGAMEPACKET for servers to request clients' clear their decal cache.

This commit is contained in:
Marco Cawthorne 2022-08-27 22:05:31 -07:00
parent 27529eb3a6
commit 9e675c212d
Signed by: eukara
GPG key ID: CE2032F0A2882A22
3 changed files with 17 additions and 0 deletions

View file

@ -130,6 +130,15 @@ CMD_player_geomtest(void)
setcustomskin(pSeat->m_ePlayer, "", sprintf("geomset %s %s\n", argv(1), argv(2)));
}
void
CMD_Cleardecals(void)
{
for (entity e = world; (e = find(e, ::classname, "tempdecal"));) {
decal dcl = (decal)e;
dcl.m_strShader = "";
}
}
/*
=================
Cmd_Parse
@ -144,6 +153,9 @@ int
Cmd_Parse(string sCMD)
{
switch (argv(0)) {
case "cleardecals":
CMD_Cleardecals();
break;
case "testPointLight":
CMD_testPointLight();
break;
@ -314,6 +326,7 @@ Cmd_Init(void)
print("--------- Initializing Cmds ----------\n");
/* developer/debug commands */
registercommand("cleardecals");
registercommand("testLight");
registercommand("testPointLight");
registercommand("getpos");

View file

@ -118,6 +118,9 @@ Event_Parse(float type)
g_view.SetCameraAngle(a);
g_view.SetClientAngle(a);
break;
case EV_CLEARDECALS:
CMD_Cleardecals();
break;
case EV_SHAKE:
if (me.classname == "spectator")
break;

View file

@ -48,5 +48,6 @@ enum
EV_CHAT_TEAM,
EV_CHAT_VOX,
EV_VIEWMODEL,
EV_CLEARDECALS,
EV_SEPARATOR
};