From 6f87303a2691565d6fad67817a8e1ec7a58948e2 Mon Sep 17 00:00:00 2001 From: Christopher Schwarz Date: Sat, 22 Jan 2011 12:10:29 +0000 Subject: * (bug 4883) Fix ability to build 0-BP structures in SD if the blueprint is active at the transition by clearing blueprints upon entering SD (thanks Menace13) * Print SD warning/beginning to the client console text in addition to the CP * Change a couple STAT_BUILDABLE = 0 to = BA_NONE (code tidying with no effect) --- src/game/g_active.c | 2 +- src/game/g_cmds.c | 2 +- src/game/g_main.c | 12 +++++++++++- 3 files changed, 13 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/game/g_active.c b/src/game/g_active.c index 697800f6..fa18c30c 100644 --- a/src/game/g_active.c +++ b/src/game/g_active.c @@ -462,7 +462,7 @@ void SpectatorThink( gentity_t *ent, usercmd_t *ucmd ) client->ps.speed = client->pers.flySpeed; client->ps.stats[ STAT_STAMINA ] = 0; client->ps.stats[ STAT_MISC ] = 0; - client->ps.stats[ STAT_BUILDABLE ] = 0; + client->ps.stats[ STAT_BUILDABLE ] = BA_NONE; client->ps.stats[ STAT_CLASS ] = PCL_NONE; client->ps.weapon = WP_NONE; diff --git a/src/game/g_cmds.c b/src/game/g_cmds.c index 06363c7a..449dc8d7 100644 --- a/src/game/g_cmds.c +++ b/src/game/g_cmds.c @@ -2365,7 +2365,7 @@ void Cmd_Build_f( gentity_t *ent ) dynMenu_t err; dist = BG_Class( ent->client->ps.stats[ STAT_CLASS ] )->buildDist; - ent->client->ps.stats[ STAT_BUILDABLE ] = 0; + ent->client->ps.stats[ STAT_BUILDABLE ] = BA_NONE; //these are the errors displayed when the builder first selects something to use switch( G_CanBuild( ent, buildable, dist, origin ) ) diff --git a/src/game/g_main.c b/src/game/g_main.c index 765dfce4..e28effd4 100644 --- a/src/game/g_main.c +++ b/src/game/g_main.c @@ -1145,14 +1145,24 @@ void G_CalculateBuildPoints( void ) { G_LogPrintf( "Beginning Sudden Death\n" ); trap_SendServerCommand( -1, "cp \"Sudden Death!\"" ); + trap_SendServerCommand( -1, "print \"Beginning Sudden Death.\n\"" ); level.suddenDeathWarning = TW_PASSED; G_ClearDeconMarks( ); + + // Clear blueprints, or else structs that cost 0 BP can still be built after SD + for( i = 0; i < level.maxclients; i++ ) + { + if( g_entities[ i ].client->ps.stats[ STAT_BUILDABLE ] != BA_NONE ) + g_entities[ i ].client->ps.stats[ STAT_BUILDABLE ] = BA_NONE; + } } else if( G_TimeTilSuddenDeath( ) <= SUDDENDEATHWARNING && level.suddenDeathWarning < TW_IMMINENT ) { trap_SendServerCommand( -1, va( "cp \"Sudden Death in %d seconds!\"", - (int)(G_TimeTilSuddenDeath() / 1000 ) ) ); + (int)( G_TimeTilSuddenDeath( ) / 1000 ) ) ); + trap_SendServerCommand( -1, va( "print \"Sudden Death will begin in %d seconds.\n\"", + (int)( G_TimeTilSuddenDeath( ) / 1000 ) ) ); level.suddenDeathWarning = TW_IMMINENT; } -- cgit