Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

allow maps to override buildpoint limits

note: this implementation uses the crappy write-cvar-and-revert-upon-exit solution
  • Loading branch information...
commit 5008ce8a7449221b05529761ec6367239a791b1c 1 parent 66770c3
/dev/humancontroller authored dsalt committed
9 src/gamelogic/gpp/src/game/g_main.c
View
@@ -187,6 +187,9 @@ vmCvar_t g_combatCooldown;
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[] =
{
@@ -262,11 +265,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 },
9 src/gamelogic/gpp/src/game/g_spawn.c
View
@@ -621,6 +621,15 @@ void SP_worldspawn( void )
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 );
Please sign in to comment.
Something went wrong with that request. Please try again.