diff --git a/README.md b/README.md
index e482d7e0c..9af69b410 100644
--- a/README.md
+++ b/README.md
@@ -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.
`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. |
+| mp_friendlyflash_damage | 4 | 0 | - | Flashbang grenade damage for teammates.
`0` disabled |
## How to install zBot for CS 1.6?
diff --git a/dist/game.cfg b/dist/game.cfg
index b096befb9..06542668d 100644
--- a/dist/game.cfg
+++ b/dist/game.cfg
@@ -344,3 +344,9 @@ mp_unduck_method 0
//
// Default value: "1"
mp_weapons_allow_map_placed 1
+
+// Flashbang grenade damage for teammates.
+// 0 - disabled
+//
+// Default value: "4"
+mp_friendlyflash_damage 4
diff --git a/regamedll/dlls/combat.cpp b/regamedll/dlls/combat.cpp
index f5ec1ce15..299e20a18 100644
--- a/regamedll/dlls/combat.cpp
+++ b/regamedll/dlls/combat.cpp
@@ -65,6 +65,21 @@ 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 (pPlayer->edict() != ENT(pevAttacker) && g_pGameRules->PlayerRelationship(CBasePlayer::Instance(pevAttacker), pPlayer) == GR_TEAMMATE)
+ {
+ if (friendlyflash_damage.value > 0.0f)
+ {
+ flDamage = friendlyflash_damage.value;
+ falloff = flDamage / flRadius;
+ }
+ else
+ {
+ continue;
+ }
+ }
+#endif
+
if (bInWater && pPlayer->pev->waterlevel == 0)
continue;
diff --git a/regamedll/dlls/game.cpp b/regamedll/dlls/game.cpp
index 1a3a18650..ec8f7c351 100644
--- a/regamedll/dlls/game.cpp
+++ b/regamedll/dlls/game.cpp
@@ -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 friendlyflash_damage = { "mp_friendlyflash_damage", "4", FCVAR_SERVER, 0.0f, nullptr };
void GameDLL_Version_f()
{
@@ -352,6 +353,7 @@ void EXT_FUNC GameDLLInit()
CVAR_REGISTER(&radio_timeout);
CVAR_REGISTER(&radio_maxinround);
+ CVAR_REGISTER(&friendlyflash_damage);
// print version
CONSOLE_ECHO("ReGameDLL version: " APP_VERSION "\n");
diff --git a/regamedll/dlls/game.h b/regamedll/dlls/game.h
index 293417267..7db640a65 100644
--- a/regamedll/dlls/game.h
+++ b/regamedll/dlls/game.h
@@ -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 friendlyflash_damage;
#endif