From e29bb2aa2d18b785d759f94fef30ce8f60a658ce Mon Sep 17 00:00:00 2001 From: ac-stef Date: Tue, 27 Jun 2017 13:31:02 +0200 Subject: [PATCH] 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 --- source/src/entity.h | 4 +++- source/src/rendermodel.cpp | 2 +- source/src/weapon.cpp | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/source/src/entity.h b/source/src/entity.h index 438142eb..45438574 100644 --- a/source/src/entity.h +++ b/source/src/entity.h @@ -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) diff --git a/source/src/rendermodel.cpp b/source/src/rendermodel.cpp index 78b8851a..c6be403a 100644 --- a/source/src/rendermodel.cpp +++ b/source/src/rendermodel.cpp @@ -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; diff --git a/source/src/weapon.cpp b/source/src/weapon.cpp index cdfb5de4..633d675c 100644 --- a/source/src/weapon.cpp +++ b/source/src/weapon.cpp @@ -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) {