Client: Make sure the weaponFX gets wiped upon any weapon-switch, to avoid

anything from still drawing upon respawn or forced switches
This commit is contained in:
Marco Cawthorne 2021-02-18 09:54:52 +01:00
parent 136b274d36
commit b702f166d1
3 changed files with 26 additions and 5 deletions

View file

@ -4,15 +4,29 @@ r_part beam
tcoords 0 0 16 16 32
scale 1
scalefactor 0.8
step 0.25
alpha 0.1
step 1
alpha 0.25
spawnmode spiral 32
spawnorg 3
spawnvel 18
blend adda
rgbf 0.5 0.5 1.0
}
}
r_part +beam
{
texture "particles/fteparticlefont.tga"
tcoords 97 97 191 191 256
scale 2
scaledelta 0.25
rgbf 1 1 1
alpha 0.25
blend add
step 4
randomvel 0
type beam
}
r_part trail
{
texture "classicparticle"
tcoords 0 0 16 16 32

View file

@ -66,10 +66,10 @@ FXEgon::Draw(void)
endpos = src + v_forward * 1024;
traceline(src, endpos, FALSE, pl);
dynamiclight_add(trace_endpos + v_forward * -16, 128, [0.25, 0.25, 1.0]);
dynamiclight_add(trace_endpos + v_forward * -16, 128, [0.5, 0.5, 1.0]);
trailparticles(TRAIL_EGONBEAM, pl, gunpos, trace_endpos);
setorigin(this, trace_endpos + v_forward * -16);
/*
R_BeginPolygon(SPRITE_EGONIMPACT, 1, 0);
R_PolygonVertex(trace_endpos + v_right * 24 - v_up * 24 + v_forward * -16, [1,1], [1,1,1], 1.0f);

View file

@ -76,6 +76,13 @@ void Weapons_Draw(void)
pl.w_idle_next = 2.5f;
pl.viewzoom = 1.0f;
#ifdef CLIENT
entity eold = self;
self = pSeat->m_pWeaponFX;
spawnfunc_CBaseFX();
self = eold;
#endif
/* make sure this is all wiped */
pl.a_ammo1 = pl.a_ammo2 = pl.a_ammo3 = 0;