Half-Life: Fix viewmodel still drawing when dead, player moving

This commit is contained in:
Marco Cawthorne 2021-02-13 10:07:52 +01:00
parent 97f90ae72c
commit 2449fa492e
3 changed files with 6 additions and 5 deletions

View file

@ -304,7 +304,7 @@ CSQC_UpdateView(float w, float h, float focus)
SkyCamera_Setup(getproperty(VF_ORIGIN));
/* draw the viewmodel in a second pass if desired */
if (autocvar_r_viewmodelpass) {
if (autocvar_r_viewmodelpass && pl.health > 0) {
renderscene();
clearscene();
setproperty(VF_MIN, video_mins);
@ -314,12 +314,11 @@ CSQC_UpdateView(float w, float h, float focus)
setproperty(VF_AFOV, autocvar_r_viewmodelfov);
setproperty(VF_ORIGIN, pSeat->m_vecPredictedOrigin + pl.view_ofs);
View_DrawViewModel();
CSQC_RenderScene();
} else {
} else if (pl.health > 0) {
View_DrawViewModel();
CSQC_RenderScene();
}
CSQC_RenderScene();
RenderTarget_Monitor_Update();
for (entity b = world; (b = findfloat(b, ::isCSQC, 1));) {

View file

@ -696,7 +696,7 @@ PMove_Run(void)
input_movevalues *= 0.25;
}
if (pl.flags & FL_FROZEN) {
if (pl.flags & FL_FROZEN || pl.movetype == MOVETYPE_NONE) {
input_movevalues = [0,0,0];
input_buttons &= ~INPUT_BUTTON2;
}

View file

@ -88,6 +88,8 @@ HLMultiplayerRules::PlayerDeath(base_player pl)
pl.takedamage = DAMAGE_NO;
pl.gflags &= ~GF_FLASHLIGHT;
pl.armor = pl.activeweapon = pl.g_items = 0;
pl.health = 0;
Sound_Play(pl, CHAN_AUTO, "player.die");
/* force respawn */