summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristopher Schwarz <lakitu7@gmail.com>2010-03-31 20:15:25 +0000
committerTim Angus <tim@ngus.net>2013-01-03 00:17:32 +0000
commite852aff93e0691a050d876dada16eb15ecd1b134 (patch)
tree6a26fb150f72177f1b6ba3e06231c91be52edc81 /src
parent2d0ece61b1b55c64831a51c0e050f914bcc28d29 (diff)
* (bug 4538) Unpowered marked buildables are not ignored when freeing build points (Rezyn)
Diffstat (limited to 'src')
-rw-r--r--src/game/g_buildable.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/game/g_buildable.c b/src/game/g_buildable.c
index 964c76bb..973c7b91 100644
--- a/src/game/g_buildable.c
+++ b/src/game/g_buildable.c
@@ -3114,6 +3114,10 @@ static itemBuildError_t G_SufficientBPAvailable( buildable_t buildable,
buildable != core )
continue;
+ // Don't include unpowered buildables
+ if( !collision && !ent->powered )
+ continue;
+
if( ent->deconstruct )
{
level.markedBuildables[ numBuildables++ ] = ent;
@@ -3132,14 +3136,16 @@ static itemBuildError_t G_SufficientBPAvailable( buildable_t buildable,
if( repeaterInRange )
repeaterInRangeCount--;
- pointsYielded += BG_Buildable( ent->s.modelindex )->buildPoints;
+ if( ent->powered )
+ pointsYielded += BG_Buildable( ent->s.modelindex )->buildPoints;
level.numBuildablesForRemoval++;
}
else if( BG_Buildable( ent->s.modelindex )->uniqueTest &&
ent->s.modelindex == buildable )
{
// If it's a unique buildable, it must be replaced by the same type
- pointsYielded += BG_Buildable( ent->s.modelindex )->buildPoints;
+ if( ent->powered )
+ pointsYielded += BG_Buildable( ent->s.modelindex )->buildPoints;
level.numBuildablesForRemoval++;
}
}
@@ -3168,7 +3174,8 @@ static itemBuildError_t G_SufficientBPAvailable( buildable_t buildable,
level.numBuildablesForRemoval++ )
{
ent = level.markedBuildables[ level.numBuildablesForRemoval ];
- pointsYielded += BG_Buildable( ent->s.modelindex )->buildPoints;
+ if( ent->powered )
+ pointsYielded += BG_Buildable( ent->s.modelindex )->buildPoints;
}
for( i = 0; i < level.numBuildablesForRemoval; i++ )