diff options
Diffstat (limited to 'src/game')
-rw-r--r-- | src/game/g_buildable.c | 24 | ||||
-rw-r--r-- | src/game/g_cmds.c | 8 | ||||
-rw-r--r-- | src/game/g_local.h | 1 | ||||
-rw-r--r-- | src/game/g_main.c | 16 |
4 files changed, 32 insertions, 17 deletions
diff --git a/src/game/g_buildable.c b/src/game/g_buildable.c index 25edb023..48ac579b 100644 --- a/src/game/g_buildable.c +++ b/src/game/g_buildable.c @@ -2988,6 +2988,30 @@ static int G_CompareBuildablesForRemoval( const void *a, const void *b ) /* =============== +G_ClearDeconMarks + +Remove decon mark from all buildables +=============== +*/ +void G_ClearDeconMarks( void ) +{ + int i; + gentity_t *ent; + + for( i = MAX_CLIENTS, ent = g_entities + i ; i < level.num_entities ; i++, ent++ ) + { + if( !ent->inuse ) + continue; + + if( ent->s.eType != ET_BUILDABLE ) + continue; + + ent->deconstruct = qfalse; + } +} + +/* +=============== G_FreeMarkedBuildables Free up build points for a team by deconstructing marked buildables diff --git a/src/game/g_cmds.c b/src/game/g_cmds.c index b822e8b9..e4d4f180 100644 --- a/src/game/g_cmds.c +++ b/src/game/g_cmds.c @@ -1205,7 +1205,8 @@ void Cmd_CallVote_f( gentity_t *ent ) va( "print \"callvote: Sudden Death has already begun\n\"") ); return; } - if( G_TimeTilSuddenDeath() <= g_suddenDeathVoteDelay.integer * 1000 ) + if( g_suddenDeathTime.integer > 0 && + G_TimeTilSuddenDeath() <= g_suddenDeathVoteDelay.integer * 1000 ) { trap_SendServerCommand( ent - g_entities, va( "print \"callvote: Sudden Death is already immenent\n\"") ); @@ -1214,13 +1215,14 @@ void Cmd_CallVote_f( gentity_t *ent ) level.voteThreshold[ team ] = g_suddenDeathVotePercent.integer; Com_sprintf( level.voteString[ team ], sizeof( level.voteString[ team ] ), "suddendeath %d", g_suddenDeathVoteDelay.integer ); - strcpy( level.voteDisplayString[ team ], "Begin sudden death" ); + strcpy( level.voteDisplayString[ team ], + va( "Begin sudden death in %d seconds", g_suddenDeathVoteDelay.integer ) ); } else { trap_SendServerCommand( ent-g_entities, "print \"Invalid vote string\n\"" ); trap_SendServerCommand( ent-g_entities, "print \"Valid vote commands are: " - "map, nextmap, map_restart, draw, kick, mute and unmute\n" ); + "map, nextmap, map_restart, draw, sudden_death, kick, mute and unmute\n" ); return; } } diff --git a/src/game/g_local.h b/src/game/g_local.h index b5c643a6..f16cf383 100644 --- a/src/game/g_local.h +++ b/src/game/g_local.h @@ -740,6 +740,7 @@ qboolean G_FindCreep( gentity_t *self ); void G_BuildableThink( gentity_t *ent, int msec ); qboolean G_BuildableRange( vec3_t origin, float r, buildable_t buildable ); +void G_ClearDeconMarks( void ); itemBuildError_t G_CanBuild( gentity_t *ent, buildable_t buildable, int distance, vec3_t origin ); qboolean G_BuildIfValid( gentity_t *ent, buildable_t buildable ); void G_SetBuildableAnim( gentity_t *ent, buildableAnimNumber_t anim, qboolean force ); diff --git a/src/game/g_main.c b/src/game/g_main.c index 70bc49a1..82a790d9 100644 --- a/src/game/g_main.c +++ b/src/game/g_main.c @@ -1101,6 +1101,7 @@ void G_CalculateBuildPoints( void ) G_LogPrintf( "Beginning Sudden Death\n" ); trap_SendServerCommand( -1, "cp \"Sudden Death!\"" ); level.suddenDeathWarning = TW_PASSED; + G_ClearDeconMarks( ); } else if( G_TimeTilSuddenDeath( ) <= SUDDENDEATHWARNING && level.suddenDeathWarning < TW_IMMINENT ) @@ -2176,21 +2177,8 @@ void CheckCvars( void ) // the server setting is changed if( g_markDeconstruct.modificationCount != lastMarkDeconModCount ) { - int i; - gentity_t *ent; - lastMarkDeconModCount = g_markDeconstruct.modificationCount; - - for( i = 1, ent = g_entities + i ; i < level.num_entities ; i++, ent++ ) - { - if( !ent->inuse ) - continue; - - if( ent->s.eType != ET_BUILDABLE ) - continue; - - ent->deconstruct = qfalse; - } + G_ClearDeconMarks( ); } // If we change g_suddenDeathTime during a map, we need to update |