From aeea713a198239a8c183c592dd2f461ad5e391d6 Mon Sep 17 00:00:00 2001 From: Shorohov Sergey Date: Sun, 27 Oct 2019 17:15:45 +0300 Subject: [PATCH] New CVar mp_weapons_allow_map_placed (#429) * Add new CVar: mp_weapons_allow_map_placed - When set, map weapons (located on the floor) will be shown. --- README.md | 1 + dist/game.cfg | 8 ++++++++ regamedll/dlls/game.cpp | 2 ++ regamedll/dlls/game.h | 1 + regamedll/dlls/weapons.cpp | 6 ++++++ 5 files changed, 18 insertions(+) diff --git a/README.md b/README.md index 29e29885..e482d7e0 100644 --- a/README.md +++ b/README.md @@ -83,6 +83,7 @@ Archive's bin directory contains 2 subdirectories, 'bugfixed' and 'pure' | mp_radio_timeout | 1.5 | 0.0 | - | Delay between player Radio messages. (in seconds).
`0` disable delay | | mp_radio_maxinround | 60 | - | - | Maximum Radio messages count for player per round.
`0` disable radio messages | | mp_buy_anywhere | 0 | 0 | 3 | When set, players can buy anywhere, not only in buyzones.
`0` disabled.
`1` both teams
`2` only Terrorists team
`3` only CT team | +| mp_weapons_allow_map_placed | 1 | 0 | 1 | When set, map weapons (located on the floor by map) will be shown.
`0` hide all map weapons.
`1` enabled
`NOTE`: Effect will work after round restart. | ## How to install zBot for CS 1.6? diff --git a/dist/game.cfg b/dist/game.cfg index 18599ae7..b096befb 100644 --- a/dist/game.cfg +++ b/dist/game.cfg @@ -336,3 +336,11 @@ mp_buy_anywhere 0 // // Default value: "0" mp_unduck_method 0 + +// When set, map weapons (located on the floor) will be shown. +// NOTE: Effect will work after round restart. +// 0 - hide all map weapons +// 1 - enabled (default behaviour) +// +// Default value: "1" +mp_weapons_allow_map_placed 1 diff --git a/regamedll/dlls/game.cpp b/regamedll/dlls/game.cpp index d34fa558..1a3a1865 100644 --- a/regamedll/dlls/game.cpp +++ b/regamedll/dlls/game.cpp @@ -124,6 +124,7 @@ cvar_t respawn_immunity_effects = { "mp_respawn_immunity_effects", "1", FCVAR_S cvar_t kill_filled_spawn = { "mp_kill_filled_spawn", "1", 0, 0.0f, nullptr }; cvar_t afk_bomb_drop_time = { "mp_afk_bomb_drop_time", "0", FCVAR_SERVER, 0.0f, nullptr }; cvar_t buy_anywhere = { "mp_buy_anywhere", "0", FCVAR_SERVER, 0.0f, nullptr }; +cvar_t weapons_allow_map_placed = { "mp_weapons_allow_map_placed", "1", FCVAR_SERVER, 0.0f, nullptr }; cvar_t allow_point_servercommand = { "mp_allow_point_servercommand", "0", 0, 0.0f, nullptr }; cvar_t hullbounds_sets = { "mp_hullbounds_sets", "1", 0, 0.0f, nullptr }; @@ -342,6 +343,7 @@ void EXT_FUNC GameDLLInit() CVAR_REGISTER(&allow_point_servercommand); CVAR_REGISTER(&hullbounds_sets); CVAR_REGISTER(&unduck_method); + CVAR_REGISTER(&weapons_allow_map_placed); CVAR_REGISTER(&ff_damage_reduction_bullets); CVAR_REGISTER(&ff_damage_reduction_grenade); diff --git a/regamedll/dlls/game.h b/regamedll/dlls/game.h index 3bf50ab0..29341726 100644 --- a/regamedll/dlls/game.h +++ b/regamedll/dlls/game.h @@ -161,6 +161,7 @@ extern cvar_t respawn_immunity_effects; extern cvar_t kill_filled_spawn; extern cvar_t afk_bomb_drop_time; extern cvar_t buy_anywhere; +extern cvar_t weapons_allow_map_placed; extern cvar_t allow_point_servercommand; extern cvar_t hullbounds_sets; extern cvar_t unduck_method; diff --git a/regamedll/dlls/weapons.cpp b/regamedll/dlls/weapons.cpp index d800cee2..7d4b0d02 100644 --- a/regamedll/dlls/weapons.cpp +++ b/regamedll/dlls/weapons.cpp @@ -2114,6 +2114,12 @@ void CArmoury::Spawn() void CArmoury::Restart() { #ifdef REGAMEDLL_FIXES + if (!weapons_allow_map_placed.value) + { + Hide(); + return; + } + // This code refers to the mode of Escape. (Because there is relationship to the team Terrorists) if (CSGameRules()->m_bMapHasEscapeZone) #endif