summaryrefslogtreecommitdiff
path: root/src/game/g_spawn.c
diff options
context:
space:
mode:
authorM. Kristall <mkpdev@gmail.com>2011-02-01 03:50:43 +0000
committerTim Angus <tim@ngus.net>2013-01-03 00:17:56 +0000
commit07c4991f25d0f11beb138bb34a3f934e28325849 (patch)
tree1bac6948e025ed8d9f1f770c7380f20fba540bdf /src/game/g_spawn.c
parentb143b76b53eaf1beab387564c8209d7666244aa9 (diff)
* Change how r2097 makes map-set values non-persistent and make map configs work
properly * Also disallow maps from setting stage thresholds since some maps were being very annoying
Diffstat (limited to 'src/game/g_spawn.c')
-rw-r--r--src/game/g_spawn.c39
1 files changed, 13 insertions, 26 deletions
diff --git a/src/game/g_spawn.c b/src/game/g_spawn.c
index 43e2c34b..45b10f93 100644
--- a/src/game/g_spawn.c
+++ b/src/game/g_spawn.c
@@ -31,6 +31,7 @@ qboolean G_SpawnString( const char *key, const char *defaultString, char **out )
{
*out = (char *)defaultString;
// G_Error( "G_SpawnString() called while not spawning" );
+ return qfalse;
}
for( i = 0; i < level.numSpawnVars; i++ )
@@ -602,33 +603,23 @@ void SP_worldspawn( void )
trap_SetConfigstring( CS_MOTD, g_motd.string ); // message of the day
- G_SpawnFloat( "gravity", "800", &level.gravity );
-
- G_SpawnInt( "humanMaxStage", DEFAULT_HUMAN_MAX_STAGE, &level.humanMaxStage );
-
- G_SpawnInt( "humanStage2Threshold", DEFAULT_HUMAN_STAGE2_THRESH,
- &level.humanStage2Threshold );
+ if( G_SpawnString( "gravity", "", &s ) )
+ trap_Cvar_Set( "g_gravity", s );
- G_SpawnInt( "humanStage3Threshold", DEFAULT_HUMAN_STAGE3_THRESH,
- &level.humanStage3Threshold );
+ if( G_SpawnString( "humanMaxStage", "", &s ) )
+ trap_Cvar_Set( "g_humanMaxStage", s );
- G_SpawnInt( "alienMaxStage", DEFAULT_ALIEN_MAX_STAGE,
- &level.alienMaxStage );
+ if( G_SpawnString( "alienMaxStage", "", &s ) )
+ trap_Cvar_Set( "g_alienMaxStage", s );
- G_SpawnInt( "alienStage2Threshold", DEFAULT_ALIEN_STAGE2_THRESH,
- &level.alienStage2Threshold );
+ if( G_SpawnString( "disabledEquipment", "", &s ) )
+ trap_Cvar_Set( "g_disabledEquipment", s );
- G_SpawnInt( "alienStage3Threshold", DEFAULT_ALIEN_STAGE3_THRESH,
- &level.alienStage3Threshold );
+ if( G_SpawnString( "disabledClasses", "", &s ) )
+ trap_Cvar_Set( "g_disabledClasses", s );
- G_SpawnString( "disabledEquipment", "", &s );
- trap_Cvar_Set( "g_disabledEquipment", s );
-
- G_SpawnString( "disabledClasses", "", &s );
- trap_Cvar_Set( "g_disabledClasses", s );
-
- G_SpawnString( "disabledBuildables", "", &s );
- trap_Cvar_Set( "g_disabledBuildables", s );
+ if( G_SpawnString( "disabledBuildables", "", &s ) )
+ trap_Cvar_Set( "g_disabledBuildables", s );
g_entities[ ENTITYNUM_WORLD ].s.number = ENTITYNUM_WORLD;
g_entities[ ENTITYNUM_WORLD ].classname = "worldspawn";
@@ -657,8 +648,6 @@ Parses textual entity definitions out of an entstring and spawns gentities.
*/
void G_SpawnEntitiesFromString( void )
{
- // allow calls to G_Spawn*()
- level.spawning = qtrue;
level.numSpawnVars = 0;
// the worldspawn is not an actual entity, but it still
@@ -672,7 +661,5 @@ void G_SpawnEntitiesFromString( void )
// parse ents
while( G_ParseSpawnVars( ) )
G_SpawnGEntityFromSpawnVars( );
-
- level.spawning = qfalse; // any future calls to G_Spawn*() will be errors
}