]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add rudimentary support for surfaceparm nodamage (negates fall damage)
authorMario <mario.mario@y7mail.com>
Sat, 28 Dec 2019 15:19:51 +0000 (01:19 +1000)
committerMario <mario.mario@y7mail.com>
Sat, 28 Dec 2019 15:19:51 +0000 (01:19 +1000)
qcsrc/common/weapons/weapon/porto.qc
qcsrc/server/sv_main.qc

index 0e482d8ae82db239dbdd14160070da41befea332..44b73fb05ab3a3db2d121ee585abe14700902c3b 100644 (file)
@@ -43,7 +43,7 @@ void Porto_Draw(entity this)
                        dir = reflect(dir, trace_plane_normal);
                        pos = trace_endpos;
                        wepent.polyline[++idx] = pos;
-                       if (trace_dphitq3surfaceflags & Q3SURFACEFLAG_SLICK || trace_dphitcontents & DPCONTENTS_PLAYERCLIP)
+                       if ((trace_dphitq3surfaceflags & Q3SURFACEFLAG_SLICK) || (trace_dphitcontents & DPCONTENTS_PLAYERCLIP))
                        {
                                n += 1;
                                continue;
index 54c9744332d5033ccbd5518f4f79b29dca36606c..345b7fdb836964b8e184c7e00c3d4ff46b23a08e 100644 (file)
@@ -120,7 +120,11 @@ void CreatureFrame_FallDamage(entity this)
                else
                        dm = min((dm - autocvar_g_balance_falldamage_minspeed) * autocvar_g_balance_falldamage_factor, autocvar_g_balance_falldamage_maxdamage);
                if (dm > 0)
-                       Damage (this, NULL, NULL, dm, DEATH_FALL.m_id, DMG_NOWEP, this.origin, '0 0 0');
+               {
+                       tracebox(this.origin, this.mins, this.maxs, this.origin - '0 0 1', MOVE_NOMONSTERS, this);
+                       if (!(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NODAMAGE))
+                               Damage (this, NULL, NULL, dm, DEATH_FALL.m_id, DMG_NOWEP, this.origin, '0 0 0');
+               }
        }
 
        if(autocvar_g_maxspeed > 0 && velocity_len > autocvar_g_maxspeed)