]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'terencehill/noclip_death_fix' into 'master'
authorMario <mario.mario@y7mail.com>
Sat, 18 Jul 2020 17:18:17 +0000 (17:18 +0000)
committerMario <mario.mario@y7mail.com>
Sat, 18 Jul 2020 17:18:17 +0000 (17:18 +0000)
Noclip death fix

See merge request xonotic/xonotic-data.pk3dir!837

qcsrc/server/g_damage.qc
qcsrc/server/player.qc

index 29588f8acce1c54f4cb4bf818239385a513b5850..417275fc270fe82964b4afaa6c285371be8e0979 100644 (file)
@@ -861,7 +861,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;
                }
index e5a8f47f90f859908e0ba951776cbd71a3bbf854..1333b2386d81e59d4673858b5f1cac89a81bbc8c 100644 (file)
@@ -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;