diff options
author | Christopher Schwarz <lakitu7@gmail.com> | 2010-03-31 19:57:04 +0000 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2013-01-03 00:17:32 +0000 |
commit | 2d0ece61b1b55c64831a51c0e050f914bcc28d29 (patch) | |
tree | a1b732b4612809a8680d7e1b10c462e8f27b83ed /src | |
parent | 55004fcab9cc37836ef376f2277de73b553bb982 (diff) |
* (bug 4325) Last spawn deconstruction check ignores available marked build points (Rezyn)
Diffstat (limited to 'src')
-rw-r--r-- | src/game/g_buildable.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/game/g_buildable.c b/src/game/g_buildable.c index 08a39062..964c76bb 100644 --- a/src/game/g_buildable.c +++ b/src/game/g_buildable.c @@ -2834,6 +2834,18 @@ static int G_CompareBuildablesForRemoval( const void *a, const void *b ) else if( !aMatches && bMatches ) return 1; + // If the only spawn is marked, prefer it last + if( cmpBuildable == BA_A_SPAWN || cmpBuildable == BA_H_SPAWN ) + { + if( ( buildableA->s.modelindex == BA_A_SPAWN && level.numAlienSpawns == 1 ) || + ( buildableA->s.modelindex == BA_H_SPAWN && level.numHumanSpawns == 1 ) ) + return 1; + + if( ( buildableB->s.modelindex == BA_A_SPAWN && level.numAlienSpawns == 1 ) || + ( buildableB->s.modelindex == BA_H_SPAWN && level.numHumanSpawns == 1 ) ) + return -1; + } + // If one matches the thing we're building, prefer it aMatches = ( buildableA->s.modelindex == cmpBuildable ); bMatches = ( buildableB->s.modelindex == cmpBuildable ); |