diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/game/g_buildable.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/game/g_buildable.c b/src/game/g_buildable.c index f8b4eb99..e11fb109 100644 --- a/src/game/g_buildable.c +++ b/src/game/g_buildable.c @@ -421,6 +421,9 @@ int G_GetBuildPoints( const vec3_t pos, team_t team, int extraDistance ) return level.powerZones[ powerPoint->zone ].totalBuildPoints - level.powerZones[ powerPoint->zone ].queuedBuildPoints; } + + // Return the BP of the main zone by default + return level.humanBuildPoints; } return 0; @@ -432,6 +435,7 @@ int G_GetBuildPoints( const vec3_t pos, team_t team, int extraDistance ) int distance = 0; vec3_t temp_v; int buildPoints = 0; + qboolean zoneFound = qfalse; if( level.suddenDeath ) { @@ -450,6 +454,8 @@ int G_GetBuildPoints( const vec3_t pos, team_t team, int extraDistance ) if( ent->s.modelindex == BA_H_REACTOR && distance <= REACTOR_BASESIZE + extraDistance ) { // Reactor is in range + zoneFound = qtrue; + buildPoints += level.humanBuildPoints; } else if( ent->s.modelindex == BA_H_REPEATER && distance <= REPEATER_BASESIZE + extraDistance ) @@ -458,6 +464,8 @@ int G_GetBuildPoints( const vec3_t pos, team_t team, int extraDistance ) { zone_t *zone = &level.powerZones[ent->zone]; + zoneFound = qtrue; + buildPoints += zone->totalBuildPoints - zone->queuedBuildPoints; } } @@ -471,6 +479,9 @@ int G_GetBuildPoints( const vec3_t pos, team_t team, int extraDistance ) if( buildPoints < 0 ) buildPoints = 0; + if( !zoneFound ) + buildPoints = level.humanBuildPoints; // if the player isn't in a zone, show the number of BP of the main zone + return buildPoints; #endif } |