summaryrefslogtreecommitdiff
path: root/src/game/g_buildable.c
diff options
context:
space:
mode:
authorMikko Tiusanen <ams@daug.net>2014-12-02 21:59:52 +0200
committerMikko Tiusanen <ams@daug.net>2014-12-02 21:59:52 +0200
commit1a59a05174d3ed6e6b75b8d9e2b5b074ebf41b38 (patch)
treebaf93ec23968e3e0a7a8e3e36b6cfbf2f93d549d /src/game/g_buildable.c
parent4c5cdb7663951909daf4c8fc77313eb20eacc884 (diff)
Added support for configuring refinery/colony effects on own and enemy team's bp pool.
Diffstat (limited to 'src/game/g_buildable.c')
-rw-r--r--src/game/g_buildable.c32
1 files changed, 11 insertions, 21 deletions
diff --git a/src/game/g_buildable.c b/src/game/g_buildable.c
index 841038f..d132890 100644
--- a/src/game/g_buildable.c
+++ b/src/game/g_buildable.c
@@ -398,30 +398,20 @@ Note: 'pos' can be NULL, in this case return the overall BP of the team.
int G_GetBuildPoints( const vec3_t pos, team_t team )
{
int value = 0;
-
- if( !G_Overmind( ) && team == TEAM_ALIENS )
- {
- return 0;
- }
- else if( team == TEAM_ALIENS )
- {
+ switch(team) {
+ case TEAM_ALIENS:
+ if ( !G_Overmind( ) ) return 0;
value = level.alienBuildPoints;
- }
- else if( !G_Reactor( ) && team == TEAM_HUMANS )
- {
- return 0;
- }
- else if( team == TEAM_HUMANS )
- {
+ break;
+ case TEAM_HUMANS:
+ if ( !G_Reactor( ) ) return 0;
value = level.humanBuildPoints;
- }
- else
- return 0;
-
- if( ( value > 0 ) && ( G_TimeTilSuddenDeath( ) <= 0 ) )
+ break;
+ default:
return 0;
- else
- return value;
+ }
+ if( ( value > 0 ) && ( G_TimeTilSuddenDeath( ) <= 0 ) ) return 0;
+ return value;
}
/*