summaryrefslogtreecommitdiff
path: root/src/game
diff options
context:
space:
mode:
authorTim Angus <tim@ngus.net>2006-04-22 22:37:55 +0000
committerTim Angus <tim@ngus.net>2006-04-22 22:37:55 +0000
commit2964a65588e3a9ef7ca121dcc358db435a938090 (patch)
tree3ef9b4d9692c00cf81e8d08fdc21b2b93b946c95 /src/game
parent16de7f593c6d6b234e05d2349c0f51956c65e5cf (diff)
* Per team friendly fire settings (from tjw)
Diffstat (limited to 'src/game')
-rw-r--r--src/game/g_combat.c13
-rw-r--r--src/game/g_local.h2
-rw-r--r--src/game/g_main.c4
3 files changed, 18 insertions, 1 deletions
diff --git a/src/game/g_combat.c b/src/game/g_combat.c
index 6d8e5c1c..d9668296 100644
--- a/src/game/g_combat.c
+++ b/src/game/g_combat.c
@@ -1019,7 +1019,18 @@ void G_Damage( gentity_t *targ, gentity_t *inflictor, gentity_t *attacker,
if( targ != attacker && OnSameTeam( targ, attacker ) )
{
if( !g_friendlyFire.integer )
- return;
+ {
+ if( !g_friendlyFireHumans.integer
+ && targ->client->ps.stats[ STAT_PTEAM ] == PTE_HUMANS )
+ {
+ return;
+ }
+ if( !g_friendlyFireAliens.integer
+ && targ->client->ps.stats[ STAT_PTEAM ] == PTE_ALIENS )
+ {
+ return;
+ }
+ }
}
// If target is buildable on the same team as the attacking client
diff --git a/src/game/g_local.h b/src/game/g_local.h
index 1d6bc99e..c528c4fb 100644
--- a/src/game/g_local.h
+++ b/src/game/g_local.h
@@ -1022,6 +1022,8 @@ extern vmCvar_t g_minCommandPeriod;
extern vmCvar_t g_timelimit;
extern vmCvar_t g_suddenDeathTime;
extern vmCvar_t g_friendlyFire;
+extern vmCvar_t g_friendlyFireHumans;
+extern vmCvar_t g_friendlyFireAliens;
extern vmCvar_t g_friendlyBuildableFire;
extern vmCvar_t g_password;
extern vmCvar_t g_needpass;
diff --git a/src/game/g_main.c b/src/game/g_main.c
index a5a06728..e1cd7ec5 100644
--- a/src/game/g_main.c
+++ b/src/game/g_main.c
@@ -44,6 +44,8 @@ vmCvar_t g_timelimit;
vmCvar_t g_suddenDeathTime;
vmCvar_t g_capturelimit;
vmCvar_t g_friendlyFire;
+vmCvar_t g_friendlyFireAliens;
+vmCvar_t g_friendlyFireHumans;
vmCvar_t g_friendlyBuildableFire;
vmCvar_t g_password;
vmCvar_t g_needpass;
@@ -130,6 +132,8 @@ static cvarTable_t gameCvarTable[ ] =
{ &g_synchronousClients, "g_synchronousClients", "0", CVAR_SYSTEMINFO, 0, qfalse },
{ &g_friendlyFire, "g_friendlyFire", "0", CVAR_ARCHIVE, 0, qtrue },
+ { &g_friendlyFireAliens, "g_friendlyFireAliens", "0", CVAR_ARCHIVE, 0, qtrue },
+ { &g_friendlyFireHumans, "g_friendlyFireHumans", "0", CVAR_ARCHIVE, 0, qtrue },
{ &g_friendlyBuildableFire, "g_friendlyBuildableFire", "0", CVAR_ARCHIVE, 0, qtrue },
{ &g_teamAutoJoin, "g_teamAutoJoin", "0", CVAR_ARCHIVE },