Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CVar mp_friendlyblind #451

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ Archive's bin directory contains 2 subdirectories, 'bugfixed' and 'pure'
| 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_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_friendlyblind | 1 | 0 | 1 | Blinding from teammates.<br/>`0` disabled <br/>`1` enabled |
</details>

## How to install zBot for CS 1.6?
Expand Down
7 changes: 7 additions & 0 deletions dist/game.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -344,3 +344,10 @@ mp_unduck_method 0
//
// Default value: "1"
mp_weapons_allow_map_placed 1

// Blinding from teammates.
// 0 - disabled
// 1 - enabled (default behaviour)
//
// Default value: "1"
mp_friendlyblind 1
5 changes: 5 additions & 0 deletions regamedll/dlls/combat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ void RadiusFlash(Vector vecSrc, entvars_t *pevInflictor, entvars_t *pevAttacker,
if (pPlayer->pev->takedamage == DAMAGE_NO || pPlayer->pev->deadflag != DEAD_NO)
continue;

#ifdef REGAMEDLL_ADD
if (!friendlyblind.value && pPlayer->edict() != ENT(pevAttacker) && g_pGameRules->PlayerRelationship(CBasePlayer::Instance(pevAttacker), pPlayer) == GR_TEAMMATE)
continue;
#endif

if (bInWater && pPlayer->pev->waterlevel == 0)
continue;

Expand Down
1 change: 1 addition & 0 deletions regamedll/dlls/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ cvar_t ff_damage_reduction_other = { "ff_damage_reduction_other",

cvar_t radio_timeout = { "mp_radio_timeout", "1.5", FCVAR_SERVER, 1.5f, nullptr };
cvar_t radio_maxinround = { "mp_radio_maxinround", "60", FCVAR_SERVER, 60.0f, nullptr };
cvar_t friendlyblind = { "mp_friendlyblind", "1", FCVAR_SERVER, 0.0f, nullptr };
Vaqtincha marked this conversation as resolved.
Show resolved Hide resolved

void GameDLL_Version_f()
{
Expand Down
1 change: 1 addition & 0 deletions regamedll/dlls/game.h
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ extern cvar_t ff_damage_reduction_grenade_self;
extern cvar_t ff_damage_reduction_other;
extern cvar_t radio_timeout;
extern cvar_t radio_maxinround;
extern cvar_t friendlyblind;

#endif

Expand Down