From: Mario Date: Sat, 28 Dec 2019 15:19:51 +0000 (+1000) Subject: Add rudimentary support for surfaceparm nodamage (negates fall damage) X-Git-Tag: xonotic-v0.8.5~1175 X-Git-Url: https://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=commitdiff_plain;h=3fbd72f57641ec279bdcf73f594c7b14982139aa Add rudimentary support for surfaceparm nodamage (negates fall damage) --- diff --git a/qcsrc/common/weapons/weapon/porto.qc b/qcsrc/common/weapons/weapon/porto.qc index 0e482d8ae8..44b73fb05a 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 54c9744332..345b7fdb83 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)