Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
SergeyShorokhov committed Jan 16, 2020
2 parents 44e7758 + 2eba3b1 commit 2694a92
Show file tree
Hide file tree
Showing 30 changed files with 438 additions and 142 deletions.
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,19 +62,22 @@ Archive's bin directory contains 2 subdirectories, 'bugfixed' and 'pure'
| mp_old_bomb_defused_sound | 1 | 0 | 1 | Play "Bomb has been defused" sound instead of "Counter-Terrorists win" when bomb was defused<br/>`0` disabled<br/>`1` enabled |
| showtriggers | 0 | 0 | 1 | Debug cvar shows triggers. |
| sv_alltalk | 0 | 0 | 4 | When players can hear each other ([further explanation](../../wiki/sv_alltalk)).<br/>`0` dead don't hear alive<br/>`1` no restrictions<br/>`2` teammates hear each other<br/>`3` Same as 2, but spectators hear everybody<br/>`4` alive hear alive, dead hear dead and alive.
| bot_deathmatch | 0 | 0 | 1 | Set's the mode for the zBot.<br/>`0` disabled<br/>`1` enable mode Deathmatch and not allow to do the scenario |
| bot_deathmatch | 0 | 0 | 1 | Sets the mode for the zBot.<br/>`0` disabled<br/>`1` enable mode Deathmatch and not allow to do the scenario |
| bot_quota_mode | normal | - | - | Determines the type of quota.<br/>`normal` default behaviour<br/>`fill` the server will adjust bots to keep `N` players in the game, where `N` is bot_quota<br/>`match` the server will maintain a `1:N` ratio of humans to bots, where `N` is bot_quota |
| bot_join_delay | 0 | - | - | Prevents bots from joining the server for this many seconds after a map change. |
| bot_freeze | 0 | 0 | 1 | Prevents bots on your server from moving.<br/>`0` disabled<br/>`1` enabled |
| mp_item_staytime | 300 | - | - | Time to remove item that have been dropped from the players. |
| mp_legacy_bombtarget_touch | 1 | 0 | 1 | Legacy func_bomb_target touch. New one is more strict. <br/>`0` New behavior<br/>`1` Legacy behavior|
| mp_respawn_immunitytime | 0 | 0 | - | Specifies the players defense time after respawn. (in seconds).<br/>`0` disabled<br/>`>0.00001` time delay to remove protection |
| mp_respawn_immunity_effects | 1 | 0 | 1 | Enable effects on player spawn protection.<br/>`0` disabled<br/>`1` enable (Use in conjunction with the cvar mp_respawn_immunitytime) |
| mp_respawn_immunity_force_unset | 1 | 0 | 1 | Force unset spawn protection if the player doing any action.<br/>`0` disabled<br/>`1` enabled |
| mp_kill_filled_spawn | 1 | 0 | 1 | Kill the player in filled spawn before spawning some one else (Prevents players stucking in each other).<br />Only disable this if you have semiclip or other plugins that prevents stucking.<br/>`0` disabled<br/>`1` enabled |
| mp_allow_point_servercommand | 0 | 0 | 1 | Allow use of point_servercommand entities in map.<br/>`0` disallow<br/>`1` allow<br/>`NOTE`: Potentially dangerous for untrusted maps. |
| mp_hullbounds_sets | 1 | 0 | 1 | Sets mins/maxs hull bounds for the player.<br/>`0` disabled<br/>`1` enabled |
| mp_unduck_method | 0 | 0 | 1 | Don't unduck if ducking isn't finished yet.<br/>`0` disabled<br/>`1` enabled<br/>`NOTE`: This also prevents double duck. |
| mp_scoreboard_showhealth | 3 | 0 | 5 | Show `HP` field into a scoreboard.<br/>`0` don't send any update for `HP` field to any clients<br/>`1` show only Terrorist `HP` field to all clients<br/>`2` show only CT `HP` field to all clients<br/>`3` show `HP` field to teammates<br/>`4` show `HP` field to all clients<br/>`5` show `HP` field to teammates and spectators<br/><br/>`Note this CVar are work in beta only.` |
| mp_scoreboard_showmoney | 3 | 0 | 5 | Show `Money` field into a scoreboard.<br/>`0` don't send any update for `Money` field to any clients<br/>`1` show only Terrorist `Money` field to all clients<br/>`2` show only CT `Money` field to all clients<br/>`3` show `Money` field to teammates<br/>`4` show `Money` field to all clients<br/>`5` show `Money` field to teammates and spectators<br/><br/>`Note this CVar are work in beta only.` |
| mp_scoreboard_showhealth | 3 | -1 | 5 | Show `HP` field into a scoreboard.<br/>`-1` disabled<br/>`0` don't send any update for `HP` field to any clients<br/>`1` show only Terrorist `HP` field to all clients<br/>`2` show only CT `HP` field to all clients<br/>`3` show `HP` field to teammates<br/>`4` show `HP` field to all clients<br/>`5` show `HP` field to teammates and spectators |
| mp_scoreboard_showmoney | 3 | -1 | 5 | Show `Money` field into a scoreboard.<br/>`-1` disabled<br/>`0` don't send any update for `Money` field to any clients<br/>`1` show only Terrorist `Money` field to all clients<br/>`2` show only CT `Money` field to all clients<br/>`3` show `Money` field to teammates<br/>`4` show `Money` field to all clients<br/>`5` show `Money` field to teammates and spectators |
| mp_scoreboard_showdefkit | 1 | 0 | 1 | Show `D. Kit` field into a scoreboard for teammates.<br/>`0` disabled<br/>`1` enabled<br/>`NOTE`: If you don't want to show `D. Kit` field for dead enemies then disable this CVar or configure mp_forcecamera |
| ff_damage_reduction_bullets | 0.35 | 0.0 | 1.0 | How much to reduce damage done to teammates when shot.<br/> Range is from `0` - `1` (with 1 being damage equal to what is done to an enemy) |
| ff_damage_reduction_grenade | 0.25 | 0.0 | 1.0 | How much to reduce damage done to teammates by a thrown grenade.<br/> Range is from `0` - `1` (with 1 being damage equal to what is done to an enemy) |
| ff_damage_reduction_grenade_self | 1.0 | 0.0 | 1.0 | How much to damage a player does to himself with his own grenade.<br/> Range is from `0` - `1` (with 1 being damage equal to what is done to an enemy) |
Expand All @@ -83,7 +86,9 @@ Archive's bin directory contains 2 subdirectories, 'bugfixed' and 'pure'
| mp_radio_timeout | 1.5 | 0.0 | - | Delay between player Radio messages. (in seconds).<br/>`0` disable delay |
| mp_radio_maxinround | 60 | - | - | Maximum Radio messages count for player per round.<br/>`0` disable radio messages |
| mp_buy_anywhere | 0 | 0 | 3 | When set, players can buy anywhere, not only in buyzones.<br/> `0` disabled.<br/>`1` both teams <br/>`2` only Terrorists team <br/>`3` only CT team |
| mp_give_player_c4 | 1 | 0 | 1 | Whether this map should spawn a C4 bomb for a player or not.<br/> `0` disabled<br/>`1` enabled |
| mp_weapons_allow_map_placed | 1 | 0 | 1 | When set, map weapons (located on the floor by map) will be shown.<br/> `0` hide all map weapons.<br/>`1` enabled<br/>`NOTE`: Effect will work after round restart. |
| mp_fadetoblack | 0 | 0 | 2 | Observer's screen will fade to black on kill event or permanent.<br/> `0` No fade.<br/>`1` Fade to black and won't be able to watch anybody.<br/>`2` fade to black only on kill moment. |
</details>

## How to install zBot for CS 1.6?
Expand Down
68 changes: 53 additions & 15 deletions dist/game.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ mp_show_scenarioicon 0
// Default value: "1"
mp_old_bomb_defused_sound 1
// Set's the mode for the zBot
// Sets the mode for the zBot
// 0 - disabled
// 1 - enable mode Deathmatch and not allow to do the scenario
//
Expand All @@ -192,6 +192,13 @@ bot_quota_mode "normal"
// Default value: "0"
bot_join_delay 0
// Prevents bots on your server from moving.
// 0 - disabled (default behavior)
// 1 - enabled
//
// Default value: "0"
bot_freeze 0
// Debug cvar shows triggers.
// 0 - disabled (default behaviour)
// 1 - enabled
Expand Down Expand Up @@ -236,6 +243,13 @@ mp_respawn_immunitytime "0"
// Default value: "1"
mp_respawn_immunity_effects 1

// Force unset spawn protection if the player doing any action.
// 0 - disabled
// 1 - enabled
//
// Default value: "1"
mp_respawn_immunity_force_unset 1

// Kill the player in filled spawn before spawning some one else (Prevents players stucking in each other).
// Only disable this if you have semiclip or other plugins that prevents stucking
// 0 - disabled
Expand All @@ -253,29 +267,38 @@ mp_kill_filled_spawn 1
mp_allow_point_servercommand 0

// Show 'HP' field into a scoreboard
// 0 - don't send any update for 'HP' field to any clients
// 1 - show only Terrorist 'HP' field to all clients
// 2 - show only CT 'HP' field to all clients
// 3 - show 'HP' field to teammates
// 4 - show 'HP' field to all clients
// 5 - show 'HP' field to teammates and spectators
// Note this CVar are work in beta only.
// -1 - disabled
// 0 - don't send any update for 'HP' field to any clients
// 1 - show only Terrorist 'HP' field to all clients
// 2 - show only CT 'HP' field to all clients
// 3 - show 'HP' field to teammates
// 4 - show 'HP' field to all clients
// 5 - show 'HP' field to teammates and spectators
//
// Default value: "3"
mp_scoreboard_showhealth 3
// Show 'Money' field into a scoreboard
// 0 - don't send any update for 'Money' field to any clients
// 1 - show only Terrorist 'Money' field to all clients
// 2 - show only CT 'Money' field to all clients
// 3 - show 'Money' field to teammates
// 4 - show 'Money' field to all clients
// 5 - show 'Money' field to teammates and spectators
// Note this CVar are work in beta only.
// -1 - disabled
// 0 - don't send any update for 'Money' field to any clients
// 1 - show only Terrorist 'Money' field to all clients
// 2 - show only CT 'Money' field to all clients
// 3 - show 'Money' field to teammates
// 4 - show 'Money' field to all clients
// 5 - show 'Money' field to teammates and spectators
//
// Default value: "3"
mp_scoreboard_showmoney 3

// Show 'D. Kit' field into a scoreboard for teammates
// NOTE: If you don't want to show defuse kit field for dead enemies
// then disable this CVar or configure mp_forcecamera
// 0 - disabled
// 1 - enabled
//
// Default value: "1"
mp_scoreboard_showdefkit 1
// How much to reduce damage done to teammates when shot.
// Range is from 0 - 1 (with 1 being damage equal to what is done to an enemy)
//
Expand Down Expand Up @@ -337,10 +360,25 @@ mp_buy_anywhere 0
// Default value: "0"
mp_unduck_method 0
// Whether this map should spawn a C4 bomb for a player or not.
// 0 - disabled
// 1 - enabled (default behaviour)
//
// Default value: "1"
mp_give_player_c4 1
// 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
// Observer's screen will fade to black on kill event or permanent.
// 0 - No fade
// 1 - Fade to black and won't be able to watch anybody
// 2 - fade to black only on kill moment.
//
// Default value: "0"
mp_fadetoblack 0
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
majorVersion=5
minorVersion=12
minorVersion=13
maintenanceVersion=0
2 changes: 2 additions & 0 deletions regamedll/dlls/bot/cs_bot_init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ cvar_t cv_bot_profile_db = { "bot_profile_db", "BotProfile.db", FCVA
cvar_t cv_bot_deathmatch = { "bot_deathmatch", "0", FCVAR_SERVER, 0.0f, nullptr };
cvar_t cv_bot_quota_mode = { "bot_quota_mode", "normal", FCVAR_SERVER, 0.0f, nullptr };
cvar_t cv_bot_join_delay = { "bot_join_delay", "0", FCVAR_SERVER, 0.0f, nullptr };
cvar_t cv_bot_freeze = { "bot_freeze", "0", 0, 0.0f, nullptr };
#else
// Migrated to bot_quota_mode, use "match"
cvar_t cv_bot_quota_match = { "bot_quota_match", "0", FCVAR_SERVER, 0.0f, nullptr };
Expand Down Expand Up @@ -129,6 +130,7 @@ void Bot_RegisterCVars()
CVAR_REGISTER(&cv_bot_deathmatch);
CVAR_REGISTER(&cv_bot_quota_mode);
CVAR_REGISTER(&cv_bot_join_delay);
CVAR_REGISTER(&cv_bot_freeze);
#endif

}
Expand Down
1 change: 1 addition & 0 deletions regamedll/dlls/bot/cs_bot_init.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ extern cvar_t cv_bot_profile_db;
extern cvar_t cv_bot_deathmatch;
extern cvar_t cv_bot_quota_mode;
extern cvar_t cv_bot_join_delay;
extern cvar_t cv_bot_freeze;
#else
extern cvar_t cv_bot_quota_match;
#endif
15 changes: 15 additions & 0 deletions regamedll/dlls/bot/cs_bot_statemachine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@
// This method is the ONLY legal way to change a bot's current state
void CCSBot::SetState(BotState *state)
{
#ifdef REGAMEDLL_ADD
if (cv_bot_freeze.value && state != &m_idleState)
return;
#endif

PrintIfWatched("SetState: %s -> %s\n", m_state ? m_state->GetName() : "NULL", state->GetName());

// if we changed state from within the special Attack state, we are no longer attacking
Expand Down Expand Up @@ -63,6 +68,11 @@ void CCSBot::Follow(CBasePlayer *pPlayer)
if (!pPlayer)
return;

#ifdef REGAMEDLL_ADD
if (cv_bot_freeze.value)
return;
#endif

// note when we began following
if (!m_isFollowing || m_leader != pPlayer)
m_followTimestamp = gpGlobals->time;
Expand Down Expand Up @@ -270,6 +280,11 @@ bool CCSBot::TryToRetreat()

void CCSBot::Hunt()
{
#ifdef REGAMEDLL_ADD
if (cv_bot_freeze.value)
return;
#endif

SetState(&m_huntState);
}

Expand Down
9 changes: 3 additions & 6 deletions regamedll/dlls/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -225,11 +225,8 @@ void LinkUserMessages()
gmsgHudTextArgs = REG_USER_MSG("HudTextArgs", -1);

#ifdef BUILD_LATEST
if (AreRunningBeta())
{
gmsgAccount = REG_USER_MSG("Account", 5);
gmsgHealthInfo = REG_USER_MSG("HealthInfo", 5);
}
gmsgAccount = REG_USER_MSG("Account", 5);
gmsgHealthInfo = REG_USER_MSG("HealthInfo", 5);
#endif
}

Expand Down Expand Up @@ -573,7 +570,7 @@ void ProcessKickVote(CBasePlayer *pVotingPlayer, CBasePlayer *pKickPlayer)
UTIL_ClientPrintAll(HUD_PRINTCENTER, "#Game_kicked", STRING(pKickPlayer->pev->netname));

#ifndef REGAMEDLL_FIXES
SERVER_COMMAND(UTIL_VarArgs("kick # %d\n", iVoteID));
SERVER_COMMAND(UTIL_VarArgs("kick #%d\n", iVoteID));
#endif
pTempEntity = nullptr;

Expand Down
19 changes: 16 additions & 3 deletions regamedll/dlls/func_break.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,22 @@ void CBreakable::Restart()
{
pev->flags |= FL_WORLDBRUSH;
}

#ifdef REGAMEDLL_FIXES
if (m_iszSpawnObject)
{
CBaseEntity *pEntity = nullptr;

while ((pEntity = UTIL_FindEntityByClassname(pEntity, STRING(m_iszSpawnObject))))
{
if (!FNullEnt(pEntity->pev->owner) && FClassnameIs(pEntity->pev->owner, "func_breakable"))
{
pEntity->SetThink(&CBaseEntity::SUB_Remove);
pEntity->pev->nextthink = gpGlobals->time + 0.1f;
}
}
}
#endif
}

void CBreakable::KeyValue(KeyValueData *pkvd)
Expand Down Expand Up @@ -821,12 +837,9 @@ void CBreakable::Die()
auto pItem = CBaseEntity::Create((char *)STRING(m_iszSpawnObject), VecBModelOrigin(pev), pev->angles, edict());

#ifdef REGAMEDLL_FIXES
// FIX: entity leak!
if (pItem)
{
pItem->pev->spawnflags |= SF_NORESPAWN;
pItem->SetThink(&CBaseEntity::SUB_Remove);
pItem->pev->nextthink = gpGlobals->time + CGameRules::GetItemKillDelay();
}
#endif

Expand Down
Loading

0 comments on commit 2694a92

Please sign in to comment.