summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Schwarz <lakitu7@gmail.com>2009-10-12 18:49:20 +0000
committerTim Angus <tim@ngus.net>2013-01-03 00:16:47 +0000
commit244808767a99cc237a477262420c43c126732088 (patch)
tree9049873ad77a5adf06426469de621571cadd8fc6
parent2971b8bcd168611f5a52cf0c0eaa6a8e770f3882 (diff)
* (bug 4301) Clear decon markers when entering sudden death (Rezyn)
* Fix ability to call sudden death votes when regular entry to sudden death is disabled * Add sudden_death to the printed list of valid vote types * Fix AdvGranger abilities appearing in tutorial text for regular Granger
-rw-r--r--src/cgame/cg_tutorial.c19
-rw-r--r--src/game/g_buildable.c24
-rw-r--r--src/game/g_cmds.c8
-rw-r--r--src/game/g_local.h1
-rw-r--r--src/game/g_main.c16
5 files changed, 41 insertions, 27 deletions
diff --git a/src/cgame/cg_tutorial.c b/src/cgame/cg_tutorial.c
index 5a650d06..38dd52f4 100644
--- a/src/cgame/cg_tutorial.c
+++ b/src/cgame/cg_tutorial.c
@@ -222,23 +222,22 @@ static void CG_AlienBuilderText( char *text, playerState_t *ps )
}
}
- if( ps->stats[ STAT_CLASS ] == PCL_ALIEN_BUILDER0 ||
- ps->stats[ STAT_CLASS ] == PCL_ALIEN_BUILDER0_UPG )
+ if( ( ps->stats[ STAT_BUILDABLE ] & ~SB_VALID_TOGGLEBIT ) == BA_NONE )
{
- if( ( ps->stats[ STAT_BUILDABLE ] & ~SB_VALID_TOGGLEBIT ) == BA_NONE )
- {
- Q_strcat( text, MAX_TUTORIAL_TEXT,
- va( "Press %s to swipe\n",
- CG_KeyNameForCommand( "+button5" ) ) );
- }
+ Q_strcat( text, MAX_TUTORIAL_TEXT,
+ va( "Press %s to swipe\n",
+ CG_KeyNameForCommand( "+button5" ) ) );
+ }
+ if( ps->stats[ STAT_CLASS ] == PCL_ALIEN_BUILDER0_UPG )
+ {
Q_strcat( text, MAX_TUTORIAL_TEXT,
va( "Press %s to launch a projectile\n",
- CG_KeyNameForCommand( "+button2" ) ) );
+ CG_KeyNameForCommand( "+button2" ) ) );
Q_strcat( text, MAX_TUTORIAL_TEXT,
va( "Press %s to walk on walls\n",
- CG_KeyNameForCommand( "+movedown" ) ) );
+ CG_KeyNameForCommand( "+movedown" ) ) );
}
}
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