From a09cca0305477e722fcbc79bcf2faef16f06c3a6 Mon Sep 17 00:00:00 2001 From: Mario Date: Sat, 15 Oct 2016 03:02:50 +1000 Subject: [PATCH] Make nexball's ball bounce off player clips (fixes ball falling into inaccessible areas on some maps) --- gamemodes.cfg | 1 + qcsrc/common/gamemodes/gamemode/nexball/nexball.qc | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/gamemodes.cfg b/gamemodes.cfg index 7d776b3b7..71f0dc179 100644 --- a/gamemodes.cfg +++ b/gamemodes.cfg @@ -489,6 +489,7 @@ set g_nexball_sound_bounce 1 "bouncing sound (0: off)" set g_nexball_basketball_trail 1 "1 to leave a trail" set g_nexball_football_trail 0 "1 to leave a trail" set g_nexball_trail_color 254 "1-256 for different colors (Quake palette, 254 is white)" +set g_nexball_playerclip_collisions 1 "make the ball bounce off clips" set g_nexball_radar_showallplayers 1 "1: show every player and the ball on the radar 0: only show teammates and the ball on the radar" seta g_nexball_safepass_maxdist 5000 "Max distance to allow save fassping (0 to turn off safe passing)" seta g_nexball_safepass_turnrate 0.1 "How fast the safe-pass ball can habge direction" diff --git a/qcsrc/common/gamemodes/gamemode/nexball/nexball.qc b/qcsrc/common/gamemodes/gamemode/nexball/nexball.qc index 163d7b81c..c9cfb00f6 100644 --- a/qcsrc/common/gamemodes/gamemode/nexball/nexball.qc +++ b/qcsrc/common/gamemodes/gamemode/nexball/nexball.qc @@ -34,6 +34,7 @@ float autocvar_g_nexball_football_bouncestop; bool autocvar_g_nexball_radar_showallplayers; bool autocvar_g_nexball_sound_bounce; int autocvar_g_nexball_trail_color; +bool autocvar_g_nexball_playerclip_collisions = true; float autocvar_g_nexball_safepass_turnrate; float autocvar_g_nexball_safepass_maxdist; @@ -552,6 +553,12 @@ void SpawnBall(entity this) set_movetype(this, MOVETYPE_FLY); + if(autocvar_g_nexball_playerclip_collisions) + { + this.dphitcontentsmask = DPCONTENTS_BODY | DPCONTENTS_SOLID | DPCONTENTS_PLAYERCLIP; + this.dphitcontentsmask |= DPCONTENTS_PLAYERCLIP; + } + if(!autocvar_g_nexball_sound_bounce) this.noise = ""; else if(this.noise == "") -- 2.39.2