From 3fbd72f57641ec279bdcf73f594c7b14982139aa Mon Sep 17 00:00:00 2001 From: Mario Date: Sun, 29 Dec 2019 01:19:51 +1000 Subject: [PATCH] Add rudimentary support for surfaceparm nodamage (negates fall damage) --- qcsrc/common/weapons/weapon/porto.qc | 2 +- qcsrc/server/sv_main.qc | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/qcsrc/common/weapons/weapon/porto.qc b/qcsrc/common/weapons/weapon/porto.qc index 0e482d8ae..44b73fb05 100644 --- a/qcsrc/common/weapons/weapon/porto.qc +++ b/qcsrc/common/weapons/weapon/porto.qc @@ -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; diff --git a/qcsrc/server/sv_main.qc b/qcsrc/server/sv_main.qc index 54c974433..345b7fdb8 100644 --- a/qcsrc/server/sv_main.qc +++ b/qcsrc/server/sv_main.qc @@ -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) -- 2.39.2