summaryrefslogtreecommitdiff
path: root/src/game/g_buildable.c
diff options
context:
space:
mode:
authorPaweł Redman <pawel.redman@gmail.com>2015-04-07 16:06:46 +0200
committerPaweł Redman <pawel.redman@gmail.com>2015-04-07 16:06:46 +0200
commiteb2a53e0296771246e953cc6e0ac940cb846e438 (patch)
treedf4fc0a36a6e954abd67d20cea45c32d3bebc1aa /src/game/g_buildable.c
parent84788917d2deb14f07c5710f2f9eaaae3f0b50a2 (diff)
Initial implementation of build point deletion.
Diffstat (limited to 'src/game/g_buildable.c')
-rw-r--r--src/game/g_buildable.c26
1 files changed, 24 insertions, 2 deletions
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 )