summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Schwarz <lakitu7@gmail.com>2009-10-08 16:36:52 +0000
committerTim Angus <tim@ngus.net>2013-01-03 00:16:42 +0000
commitfba8dc5e4e5bd5a7d77c5be7d82b8cabab76afaa (patch)
treeb5350d7c14f9d88adea7d8e81312c2424697735a
parent030f30383f37f5f4e52be312b23579eeb20f1f5e (diff)
* (bug 3391) FF Cvar cleanup
- Remove g_humanFriendlyFire and g_alienFriendlyFire - Remove the cvar "ff" and just use g_friendlyFire and g_friendlyBuildableFire
-rw-r--r--assets/ui/ingame_game.menu23
-rw-r--r--src/game/g_combat.c12
-rw-r--r--src/game/g_local.h2
-rw-r--r--src/game/g_main.c23
-rw-r--r--src/ui/ui_gameinfo.c6
5 files changed, 27 insertions, 39 deletions
diff --git a/assets/ui/ingame_game.menu b/assets/ui/ingame_game.menu
index 0bd09131..a9ab5a70 100644
--- a/assets/ui/ingame_game.menu
+++ b/assets/ui/ingame_game.menu
@@ -747,12 +747,11 @@
name info
group gameGrp
rect 0 (INFO_Y+(6*INFOELEM_H)) W INFOELEM_H
- type ITEM_TYPE_MULTI
+ type ITEM_TYPE_YESNO
style WINDOW_STYLE_EMPTY
text "Friendly Fire:"
- cvar ui_serverinfo_ff
- cvarFloatList { "Off" 0 "Humans Only" 1 "Aliens Only" 2 "Both Teams" 3 "Buildables Only" 4 "Humans and Buildables" 5 "Aliens and Buildables" 6 "Both Teams and Buildables" 7 }
textalign ALIGN_RIGHT
+ cvar ui_serverinfo_friendlyFire
textvalign VALIGN_CENTER
textalignx INFO_OFF
textscale .25
@@ -766,6 +765,24 @@
name info
group gameGrp
rect 0 (INFO_Y+(7*INFOELEM_H)) W INFOELEM_H
+ type ITEM_TYPE_YESNO
+ style WINDOW_STYLE_EMPTY
+ text "Buildable Friendly Fire:"
+ cvar ui_serverinfo_friendlyBuildableFire
+ textalign ALIGN_RIGHT
+ textvalign VALIGN_CENTER
+ textalignx INFO_OFF
+ textscale .25
+ forecolor 1 1 1 1
+ visible MENU_FALSE
+ decoration
+ }
+
+ itemDef
+ {
+ name info
+ group gameGrp
+ rect 0 (INFO_Y+(8*INFOELEM_H)) W INFOELEM_H
type ITEM_TYPE_EDITFIELD
style WINDOW_STYLE_EMPTY
text "Version:"
diff --git a/src/game/g_combat.c b/src/game/g_combat.c
index 8b5877cf..80278f9a 100644
--- a/src/game/g_combat.c
+++ b/src/game/g_combat.c
@@ -1020,17 +1020,7 @@ void G_Damage( gentity_t *targ, gentity_t *inflictor, gentity_t *attacker,
// check if friendly fire has been disabled
if( !g_friendlyFire.integer )
{
- if( !g_friendlyFireHumans.integer &&
- targ->client->ps.stats[ STAT_TEAM ] == TEAM_HUMANS )
- {
- return;
- }
-
- if( !g_friendlyFireAliens.integer &&
- targ->client->ps.stats[ STAT_TEAM ] == TEAM_ALIENS )
- {
- return;
- }
+ return;
}
}
diff --git a/src/game/g_local.h b/src/game/g_local.h
index 9d6feb5f..492bce49 100644
--- a/src/game/g_local.h
+++ b/src/game/g_local.h
@@ -1058,8 +1058,6 @@ extern vmCvar_t g_timelimit;
extern vmCvar_t g_suddenDeathTime;
extern vmCvar_t g_suddenDeath;
extern vmCvar_t g_friendlyFire;
-extern vmCvar_t g_friendlyFireHumans;
-extern vmCvar_t g_friendlyFireAliens;
extern vmCvar_t g_friendlyBuildableFire;
extern vmCvar_t g_dretchPunt;
extern vmCvar_t g_password;
diff --git a/src/game/g_main.c b/src/game/g_main.c
index e2f9eaaa..902f9a0c 100644
--- a/src/game/g_main.c
+++ b/src/game/g_main.c
@@ -44,8 +44,6 @@ vmCvar_t g_suddenDeathTime;
vmCvar_t g_suddenDeath;
vmCvar_t g_capturelimit;
vmCvar_t g_friendlyFire;
-vmCvar_t g_friendlyFireAliens;
-vmCvar_t g_friendlyFireHumans;
vmCvar_t g_friendlyBuildableFire;
vmCvar_t g_dretchPunt;
vmCvar_t g_password;
@@ -170,10 +168,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_friendlyFire, "g_friendlyFire", "0", CVAR_SERVERINFO | CVAR_ARCHIVE, 0, qtrue },
+ { &g_friendlyBuildableFire, "g_friendlyBuildableFire", "0", CVAR_SERVERINFO | CVAR_ARCHIVE, 0, qtrue },
{ &g_dretchPunt, "g_dretchPunt", "0", CVAR_ARCHIVE, 0, qtrue },
{ &g_teamForceBalance, "g_teamForceBalance", "0", CVAR_ARCHIVE },
@@ -478,12 +474,8 @@ void G_UpdateCvars( void )
cv->modificationCount = cv->vmCvar->modificationCount;
if( cv->trackChange )
- {
trap_SendServerCommand( -1, va( "print \"Server: %s changed to %s\n\"",
cv->cvarName, cv->vmCvar->string ) );
- // update serverinfo in case this cvar is passed to clients indirectly
- CalculateRanks( );
- }
}
}
}
@@ -1417,7 +1409,6 @@ void CalculateRanks( void )
{
int i;
char P[ MAX_CLIENTS + 1 ] = {""};
- int ff = 0;
level.numConnectedClients = 0;
level.numPlayingClients = 0;
@@ -1465,16 +1456,6 @@ void CalculateRanks( void )
P[ i ] = '\0';
trap_Cvar_Set( "P", P );
- if( g_friendlyFire.integer )
- ff |= ( FFF_HUMANS | FFF_ALIENS );
- if( g_friendlyFireHumans.integer )
- ff |= FFF_HUMANS;
- if( g_friendlyFireAliens.integer )
- ff |= FFF_ALIENS;
- if( g_friendlyBuildableFire.integer )
- ff |= FFF_BUILDABLES;
- trap_Cvar_Set( "ff", va( "%i", ff ) );
-
qsort( level.sortedClients, level.numConnectedClients,
sizeof( level.sortedClients[ 0 ] ), SortRanks );
diff --git a/src/ui/ui_gameinfo.c b/src/ui/ui_gameinfo.c
index c11f7248..b39be790 100644
--- a/src/ui/ui_gameinfo.c
+++ b/src/ui/ui_gameinfo.c
@@ -365,8 +365,10 @@ void UI_ServerInfo( void )
Info_ValueForKey( info, "version" ) );
trap_Cvar_Set( "ui_serverinfo_unlagged",
Info_ValueForKey( info, "g_unlagged" ) );
- trap_Cvar_Set( "ui_serverinfo_ff",
- Info_ValueForKey( info, "ff" ) );
+ trap_Cvar_Set( "ui_serverinfo_friendlyFire",
+ Info_ValueForKey( info, "g_friendlyFire" ) );
+ trap_Cvar_Set( "ui_serverinfo_friendlyBuildableFire",
+ Info_ValueForKey( info, "g_friendlyBuildableFire" ) );
trap_Cvar_Set( "ui_serverinfo_allowdl",
Info_ValueForKey( info, "sv_allowdownload" ) );
}