From a78b205e7279d0dde7842dcb9af7819d0cb4a510 Mon Sep 17 00:00:00 2001 From: Mattia Basaglia Date: Sun, 19 Mar 2017 21:53:13 +0000 Subject: [PATCH] Hide bot team from the scoreboard on single player mode --- qcsrc/client/hud/panel/scoreboard.qc | 2 ++ qcsrc/menu/xonotic/util.qc | 1 + qcsrc/server/mutators/mutator/gamemode_singleplayer.qc | 4 +++- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/qcsrc/client/hud/panel/scoreboard.qc b/qcsrc/client/hud/panel/scoreboard.qc index b8c9a3ea1..2716a2fd6 100644 --- a/qcsrc/client/hud/panel/scoreboard.qc +++ b/qcsrc/client/hud/panel/scoreboard.qc @@ -1539,6 +1539,8 @@ void Scoreboard_Draw() continue; if(!tm.team) continue; + if(tm.team != NUM_TEAM_1 && gametype == MAPINFO_TYPE_SINGLE_PLAYER) + continue; draw_beginBoldFont(); vector rgb = Team_ColorRGB(tm.team); diff --git a/qcsrc/menu/xonotic/util.qc b/qcsrc/menu/xonotic/util.qc index 7f038a85f..aabccaf30 100644 --- a/qcsrc/menu/xonotic/util.qc +++ b/qcsrc/menu/xonotic/util.qc @@ -694,6 +694,7 @@ float updateCompression() GAMETYPE(MAPINFO_TYPE_ONSLAUGHT) \ GAMETYPE(MAPINFO_TYPE_ASSAULT) \ /* GAMETYPE(MAPINFO_TYPE_INVASION) */ \ + GAMETYPE(MAPINFO_TYPE_SINGLE_PLAYER) \ /**/ // hidden gametypes come last so indexing always works correctly diff --git a/qcsrc/server/mutators/mutator/gamemode_singleplayer.qc b/qcsrc/server/mutators/mutator/gamemode_singleplayer.qc index 627aea66d..371f906af 100644 --- a/qcsrc/server/mutators/mutator/gamemode_singleplayer.qc +++ b/qcsrc/server/mutators/mutator/gamemode_singleplayer.qc @@ -256,7 +256,9 @@ MUTATOR_HOOKFUNCTION(sp, PlayerPreThink) { entity player = M_ARGV(0, entity); if ( IS_BOT_CLIENT(player) && !player.sp_spawn_spot ) + { bot_remove(player); + } } // Prevents bots from being able to pick up items @@ -268,7 +270,7 @@ MUTATOR_HOOKFUNCTION(sp, ItemTouch) return MUT_ITEMTOUCH_CONTINUE; } -// revents bots from being willing to pick up items +// Prevents bots from being willing to pick up items MUTATOR_HOOKFUNCTION(sp, Item_Spawn) { entity item = M_ARGV(0, entity); -- 2.39.2