1
0
Fork 0
forked from fte/fteqw

Hexen2: Fix invisibility artifact bugs.

This commit is contained in:
Shpoike 2023-06-05 23:44:31 +01:00
parent 2a38bc1b2d
commit 04f2e112e7
3 changed files with 17 additions and 4 deletions

View file

@ -5788,7 +5788,16 @@ void CL_LinkViewModel(void)
{ {
lerpents_t *le = &cl.lerpents[plnum+1]; lerpents_t *le = &cl.lerpents[plnum+1];
if (le->entstate) if (le->entstate)
{
playereffects = le->entstate->effects; playereffects = le->entstate->effects;
#ifdef HEXEN2
if (!le->entstate->modelindex || (le->entstate->hexen2flags & DRF_TRANSLUCENT))
{ //urgh.
ent.shaderRGBAf[3] *= .5;
ent.flags |= RF_TRANSLUCENT;
}
#endif
}
} }
} }
else if (plnum < cl.allocated_client_slots) else if (plnum < cl.allocated_client_slots)

View file

@ -590,8 +590,10 @@ static int te_515sevilhackworkaround;
#define svc_updatecolors 17 #define svc_updatecolors 17
#ifdef HEXEN2 #ifdef HEXEN2
#define svch2_clearviewflags 41 //hexen2. #define svch2_setviewflags 40 //hexen2.
#define svch2_setangles_lerp 50 #define svch2_clearviewflags 41 //hexen2.
#define svch2_setviewtint 46 //hexen2.
#define svch2_setangles_lerp 50
#endif #endif
//these are present in the darkplaces engine. //these are present in the darkplaces engine.
@ -1148,7 +1150,9 @@ void NPP_NQWriteByte(int dest, qbyte data) //replacement write func (nq to qw)
nullterms = 1; nullterms = 1;
break; break;
#ifdef HEXEN2 #ifdef HEXEN2
case svch2_clearviewflags: case svch2_setviewflags: //sets some viewmodel drawflag
case svch2_clearviewflags: //undoes svch2_setviewflags
case svch2_setviewtint: //tints the viewmodel (tied to hexen2's weird colormap stuff)
if (progstype == PROG_H2) if (progstype == PROG_H2)
{ {
protocollen = 2; protocollen = 2;

View file

@ -3683,7 +3683,7 @@ void SV_Snapshot_BuildStateQ1(entity_state_t *state, edict_t *ent, client_t *cli
//The client still needs to know about it though, as it might have other effects on it. //The client still needs to know about it though, as it might have other effects on it.
if (progstype == PROG_H2) if (progstype == PROG_H2)
{ {
if (state->effects == H2EF_NODRAW) if (state->effects & H2EF_NODRAW)
{ {
//actually, H2 is pretty lame about this //actually, H2 is pretty lame about this
state->effects = 0; state->effects = 0;