simplify decision to render corpse

instead of checking for actual gibs, check for "was gibbed"

fixes problems with still existing gibs when the player dies again fast
enough
This commit is contained in:
ac-stef
2017-06-27 13:31:02 +02:00
parent 524988feaa
commit e29bb2aa2d
3 changed files with 5 additions and 2 deletions
+3 -1
View File
@@ -448,12 +448,13 @@ public:
vec head;
bool ignored, muted;
bool nocorpse;
playerent() : curskin(0), clientnum(-1), lastupdate(0), plag(0), ping(0), address(0), lifesequence(0), frags(0), flagscore(0), deaths(0), points(0), tks(0), lastpain(0), lastvoicecom(0), lastdeath(0), clientrole(CR_DEFAULT),
team(TEAM_SPECT), spectatemode(SM_NONE), eardamagemillis(0), maxroll(ROLLMOVDEF), maxrolleffect(ROLLEFFDEF), movroll(0), effroll(0),
prevweaponsel(NULL), weaponsel(NULL), nextweaponsel(NULL), primweap(NULL), nextprimweap(NULL), lastattackweapon(NULL),
smoothmillis(-1),
head(-1, -1, -1), ignored(false), muted(false)
head(-1, -1, -1), ignored(false), muted(false), nocorpse(false)
{
type = ENT_PLAYER;
name[0] = 0;
@@ -518,6 +519,7 @@ public:
eardamagemillis = 0;
eyeheight = maxeyeheight;
curskin = nextskin[team_base(team)];
nocorpse = false;
}
void spawnstate(int gamemode)
+1 -1
View File
@@ -964,7 +964,7 @@ void renderclient(playerent *d, const char *mdlname, const char *vwepname, int t
if(d->state==CS_DEAD)
{
if(d==player1 && d->allowmove()) return;
loopv(bounceents) if(bounceents[i]->bouncetype==BT_GIB && bounceents[i]->owner==d) return;
if(d->nocorpse) return;
d->pitch = 0.1f;
anim = ANIM_DEATH;
basetime = d->lastpain;
+1
View File
@@ -723,6 +723,7 @@ void addgib(playerent *d)
{
if(!d || !gib || !gibttl) return;
audiomgr.playsound(S_GIB, d);
d->nocorpse = true; // don't render regular corpse: it was gibbed
loopi(gibnum)
{