From eb2a53e0296771246e953cc6e0ac940cb846e438 Mon Sep 17 00:00:00 2001 From: Paweł Redman Date: Tue, 7 Apr 2015 16:06:46 +0200 Subject: Initial implementation of build point deletion. --- src/game/g_buildable.c | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) (limited to 'src/game/g_buildable.c') diff --git a/src/game/g_buildable.c b/src/game/g_buildable.c index 62aa7c7..21f5424 100644 --- a/src/game/g_buildable.c +++ b/src/game/g_buildable.c @@ -401,11 +401,11 @@ int G_GetBuildPoints( const vec3_t pos, team_t team ) switch(team) { case TEAM_ALIENS: if ( !G_Overmind( ) ) return 0; - value = level.alienBuildPoints; + value = level.alienBuildPoints - level.alienDeletedBuildPoints; break; case TEAM_HUMANS: if ( !G_Reactor( ) ) return 0; - value = level.humanBuildPoints; + value = level.humanBuildPoints - level.humanDeletedBuildPoints; break; default: return 0; @@ -3313,6 +3313,28 @@ void G_QueueBuildPoints( gentity_t *self ) gentity_t *powerEntity; int queuePoints; + // if using build point deletion mode then delete BP permanently + // instead of queuing it + if( g_buildPointDeletion.integer ) + { + int points = BG_Buildable( self->s.modelindex )->buildPoints; + + switch( self->buildableTeam ) + { + case TEAM_ALIENS: + level.alienDeletedBuildPoints += points; + level.alienNoBPFlash = qtrue; + break; + + case TEAM_HUMANS: + level.humanDeletedBuildPoints += points; + level.humanNoBPFlash = qtrue; + break; + } + + return; + } + queuePoints = G_QueueValue( self ); if( !queuePoints ) -- cgit