From: terencehill Date: Wed, 8 Jul 2020 16:37:40 +0000 (+0200) Subject: With noclip enabled don't toss the corpse, it can get stuck in solid (causing low... X-Git-Tag: xonotic-v0.8.5~847^2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=64c4ea51d742a0fb65f454060cded65902c6a6e3;p=xonotic%2Fxonotic-data.pk3dir.git With noclip enabled don't toss the corpse, it can get stuck in solid (causing low fps) or fall indefinitely into the void if out of the map --- diff --git a/qcsrc/server/g_damage.qc b/qcsrc/server/g_damage.qc index 48aa78bcf..b7935a8cb 100644 --- a/qcsrc/server/g_damage.qc +++ b/qcsrc/server/g_damage.qc @@ -842,7 +842,7 @@ void Damage(entity targ, entity inflictor, entity attacker, float damage, int de farcent.nextthink = time + 0.1; setthink(farcent, SUB_Remove); } - else + else if(targ.move_movetype != MOVETYPE_NOCLIP) { targ.velocity = targ.velocity + farce; } diff --git a/qcsrc/server/player.qc b/qcsrc/server/player.qc index e5a8f47f9..1333b2386 100644 --- a/qcsrc/server/player.qc +++ b/qcsrc/server/player.qc @@ -615,8 +615,17 @@ void PlayerDamage(entity this, entity inflictor, entity attacker, float damage, this.avelocity = '0 0 0'; // view from the floor this.view_ofs = '0 0 -8'; - // toss the corpse - set_movetype(this, MOVETYPE_TOSS); + if(this.move_movetype == MOVETYPE_NOCLIP) + { + // don't toss the corpse in this case, it can get stuck in solid (causing low fps) + // or fall indefinitely into the void if out of the map + this.velocity = '0 0 0'; + } + else + { + // toss the corpse + set_movetype(this, MOVETYPE_TOSS); + } // shootable corpse this.solid = SOLID_CORPSE; PS(this).ballistics_density = autocvar_g_ballistics_density_corpse;