From 75653970ac34562ecbbb0fdd82f4365c60203684 Mon Sep 17 00:00:00 2001 From: /dev/humancontroller Date: Sun, 13 Jul 2014 16:54:57 +0200 Subject: allow maps to override buildpoint limits --- src/game/g_main.c | 9 ++++++--- src/game/g_spawn.c | 9 +++++++++ 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/game/g_main.c b/src/game/g_main.c index d0e687a8..b3d36bad 100644 --- a/src/game/g_main.c +++ b/src/game/g_main.c @@ -148,6 +148,9 @@ vmCvar_t g_tag; static char cv_gravity[ MAX_CVAR_VALUE_STRING ]; static char cv_humanMaxStage[ MAX_CVAR_VALUE_STRING ]; static char cv_alienMaxStage[ MAX_CVAR_VALUE_STRING ]; +static char cv_humanRepeaterBuildPoints[ MAX_CVAR_VALUE_STRING ]; +static char cv_humanBuildPoints[ MAX_CVAR_VALUE_STRING ]; +static char cv_alienBuildPoints[ MAX_CVAR_VALUE_STRING ]; static cvarTable_t gameCvarTable[ ] = { @@ -209,11 +212,11 @@ static cvarTable_t gameCvarTable[ ] = { &pmove_fixed, "pmove_fixed", "0", CVAR_SYSTEMINFO, 0, qfalse}, { &pmove_msec, "pmove_msec", "8", CVAR_SYSTEMINFO, 0, qfalse}, - { &g_alienBuildPoints, "g_alienBuildPoints", DEFAULT_ALIEN_BUILDPOINTS, 0, 0, qfalse }, + { &g_alienBuildPoints, "g_alienBuildPoints", DEFAULT_ALIEN_BUILDPOINTS, 0, 0, qfalse, cv_alienBuildPoints }, { &g_alienBuildQueueTime, "g_alienBuildQueueTime", DEFAULT_ALIEN_QUEUE_TIME, CVAR_ARCHIVE, 0, qfalse }, - { &g_humanBuildPoints, "g_humanBuildPoints", DEFAULT_HUMAN_BUILDPOINTS, 0, 0, qfalse }, + { &g_humanBuildPoints, "g_humanBuildPoints", DEFAULT_HUMAN_BUILDPOINTS, 0, 0, qfalse, cv_humanBuildPoints }, { &g_humanBuildQueueTime, "g_humanBuildQueueTime", DEFAULT_HUMAN_QUEUE_TIME, CVAR_ARCHIVE, 0, qfalse }, - { &g_humanRepeaterBuildPoints, "g_humanRepeaterBuildPoints", DEFAULT_HUMAN_REPEATER_BUILDPOINTS, CVAR_ARCHIVE, 0, qfalse }, + { &g_humanRepeaterBuildPoints, "g_humanRepeaterBuildPoints", DEFAULT_HUMAN_REPEATER_BUILDPOINTS, CVAR_ARCHIVE, 0, qfalse, cv_humanRepeaterBuildPoints }, { &g_humanRepeaterMaxZones, "g_humanRepeaterMaxZones", DEFAULT_HUMAN_REPEATER_MAX_ZONES, CVAR_ARCHIVE, 0, qfalse }, { &g_humanRepeaterBuildQueueTime, "g_humanRepeaterBuildQueueTime", DEFAULT_HUMAN_REPEATER_QUEUE_TIME, CVAR_ARCHIVE, 0, qfalse }, { &g_humanStage, "g_humanStage", "0", 0, 0, qfalse }, diff --git a/src/game/g_spawn.c b/src/game/g_spawn.c index d7ed7216..03c5de03 100644 --- a/src/game/g_spawn.c +++ b/src/game/g_spawn.c @@ -590,6 +590,15 @@ void SP_worldspawn( void ) if( G_SpawnString( "alienMaxStage", "", &s ) ) trap_Cvar_Set( "g_alienMaxStage", s ); + if( G_SpawnString( "humanRepeaterBuildPoints", "", &s ) ) + trap_Cvar_Set( "g_humanRepeaterBuildPoints", s ); + + if( G_SpawnString( "humanBuildPoints", "", &s ) ) + trap_Cvar_Set( "g_humanBuildPoints", s ); + + if( G_SpawnString( "alienBuildPoints", "", &s ) ) + trap_Cvar_Set( "g_alienBuildPoints", s ); + G_SpawnString( "disabledEquipment", "", &s ); trap_Cvar_Set( "g_disabledEquipment", s ); -- cgit