summaryrefslogtreecommitdiff
path: root/src/game/g_main.c
diff options
context:
space:
mode:
authorTim Angus <tim@ngus.net>2006-01-18 01:54:21 +0000
committerTim Angus <tim@ngus.net>2006-01-18 01:54:21 +0000
commitb5a24aab3dbb3d65950843c19ab2fa9934064281 (patch)
treefef77c5cc94e3376442747136421f07f9bea74b0 /src/game/g_main.c
parent5cf09669133da12cf82ee3168e57a781e47b9e92 (diff)
* Added BG_FindUsableForUpgrade
* Added BG_UpgradeClassAvailable * Added generalised BG_*IsAllowed functions * Added some binding traps to cgame * Added tutorial mode (cg_tutorial)
Diffstat (limited to 'src/game/g_main.c')
-rw-r--r--src/game/g_main.c107
1 files changed, 1 insertions, 106 deletions
diff --git a/src/game/g_main.c b/src/game/g_main.c
index e77b5b76..d3e5b13e 100644
--- a/src/game/g_main.c
+++ b/src/game/g_main.c
@@ -426,111 +426,6 @@ void G_UpdateCvars( void )
G_RemapTeamShaders( );
}
-
-typedef struct gameElements_s
-{
- buildable_t buildables[ BA_NUM_BUILDABLES ];
- pClass_t classes[ PCL_NUM_CLASSES ];
- weapon_t weapons[ WP_NUM_WEAPONS ];
- upgrade_t upgrades[ UP_NUM_UPGRADES ];
-} gameElements_t;
-
-static gameElements_t disabledGameElements;
-
-/*
-============
-G_InitAllowedGameElements
-============
-*/
-static void G_InitAllowedGameElements( void )
-{
- BG_ParseCSVEquipmentList( g_disabledEquipment.string,
- disabledGameElements.weapons, WP_NUM_WEAPONS,
- disabledGameElements.upgrades, UP_NUM_UPGRADES );
-
- BG_ParseCSVClassList( g_disabledClasses.string,
- disabledGameElements.classes, PCL_NUM_CLASSES );
-
- BG_ParseCSVBuildableList( g_disabledBuildables.string,
- disabledGameElements.buildables, BA_NUM_BUILDABLES );
-}
-
-/*
-============
-G_WeaponIsAllowed
-============
-*/
-qboolean G_WeaponIsAllowed( weapon_t weapon )
-{
- int i;
-
- for( i = 0; i < WP_NUM_WEAPONS &&
- disabledGameElements.weapons[ i ] != WP_NONE; i++ )
- {
- if( disabledGameElements.weapons[ i ] == weapon )
- return qfalse;
- }
-
- return qtrue;
-}
-
-/*
-============
-G_UpgradeIsAllowed
-============
-*/
-qboolean G_UpgradeIsAllowed( upgrade_t upgrade )
-{
- int i;
-
- for( i = 0; i < UP_NUM_UPGRADES &&
- disabledGameElements.upgrades[ i ] != UP_NONE; i++ )
- {
- if( disabledGameElements.upgrades[ i ] == upgrade )
- return qfalse;
- }
-
- return qtrue;
-}
-
-/*
-============
-G_ClassIsAllowed
-============
-*/
-qboolean G_ClassIsAllowed( pClass_t class )
-{
- int i;
-
- for( i = 0; i < PCL_NUM_CLASSES &&
- disabledGameElements.classes[ i ] != PCL_NONE; i++ )
- {
- if( disabledGameElements.classes[ i ] == class )
- return qfalse;
- }
-
- return qtrue;
-}
-
-/*
-============
-G_BuildableIsAllowed
-============
-*/
-qboolean G_BuildableIsAllowed( buildable_t buildable )
-{
- int i;
-
- for( i = 0; i < BA_NUM_BUILDABLES &&
- disabledGameElements.buildables[ i ] != BA_NONE; i++ )
- {
- if( disabledGameElements.buildables[ i ] == buildable )
- return qfalse;
- }
-
- return qtrue;
-}
-
/*
============
G_InitGame
@@ -610,7 +505,7 @@ void G_InitGame( int levelTime, int randomSeed, int restart )
G_SpawnEntitiesFromString( );
// the map might disable some things
- G_InitAllowedGameElements( );
+ BG_InitAllowedGameElements( );
// general initialization
G_FindTeams( );