From 154f87cbb2b6ea1eaef8b12ee364f409bf244323 Mon Sep 17 00:00:00 2001 From: Mircea Kitsune Date: Sun, 3 Oct 2010 14:18:12 +0300 Subject: [PATCH] Implement botclip common shader. Bot clips can now be used to block bots from specific areas of a map. The common shader should be restored with this change too. --- defaultXonotic.cfg | 1 + qcsrc/server/cl_client.qc | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/defaultXonotic.cfg b/defaultXonotic.cfg index 5b69cb0a9..2e535c395 100644 --- a/defaultXonotic.cfg +++ b/defaultXonotic.cfg @@ -521,6 +521,7 @@ set g_player_brightness 0 "set to 2 for brighter players" seta g_balance_cloaked_alpha 0.25 set g_playerclip_collisions 1 "0 = disable collision testing against playerclips, might be useful on some defrag maps" +set g_botclip_collisions 1 "0 = disable collision testing against botclips, might be useful on some defrag maps" set welcome_message_time 8 diff --git a/qcsrc/server/cl_client.qc b/qcsrc/server/cl_client.qc index 36606dec7..8bfe77424 100644 --- a/qcsrc/server/cl_client.qc +++ b/qcsrc/server/cl_client.qc @@ -867,9 +867,19 @@ void PutClientInServer (void) self.movetype = MOVETYPE_WALK; self.solid = SOLID_SLIDEBOX; if(cvar("g_playerclip_collisions")) - self.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_PLAYERCLIP; + { + if(clienttype(self) == CLIENTTYPE_BOT && cvar("g_botclip_collisions")) + self.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_PLAYERCLIP | DPCONTENTS_BOTCLIP; + else + self.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_PLAYERCLIP; + } else - self.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY; + { + if(clienttype(self) == CLIENTTYPE_BOT && cvar("g_botclip_collisions")) + self.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_BOTCLIP; + else + self.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY; + } self.frags = FRAGS_PLAYER; if(independent_players) MAKE_INDEPENDENT_PLAYER(self); -- 2.39.2