From 014043dcd74651283e1f2c1b2f8ac00f61676e4a Mon Sep 17 00:00:00 2001 From: Tim Angus Date: Sun, 1 Apr 2001 03:26:55 +0000 Subject: Fixed some stupid bugs --- src/game/g_buildable.c | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/game/g_buildable.c b/src/game/g_buildable.c index f73a0b5e..7d8e6343 100644 --- a/src/game/g_buildable.c +++ b/src/game/g_buildable.c @@ -683,6 +683,12 @@ itemBuildError_t itemFits( gentity_t *ent, buildable_t buildable, int distance ) !Q_stricmp( closestPower->classname, "team_human_reactor" ) && ( minDistance <= REACTOR_BASESIZE ) ) && + !( + !Q_stricmp( closestPower->classname, "team_human_repeater" ) && + ( minDistance <= REPEATER_BASESIZE ) && + ( buildable == BA_H_SPAWN ) && + closestPower->powered + ) && !( !Q_stricmp( closestPower->classname, "team_human_repeater" ) && ( minDistance <= REPEATER_BASESIZE ) && @@ -691,15 +697,25 @@ itemBuildError_t itemFits( gentity_t *ent, buildable_t buildable, int distance ) ) ) { - if( buildable != BA_H_REACTOR ) + if( buildable != BA_H_REACTOR && buildable != BA_H_REPEATER ) reason = IBE_REPEATER; if( buildable == BA_H_SPAWN ) reason = IBE_RPLWARN; - else if( buildable == BA_H_REPEATER ) - reason = IBE_RPTWARN; } + if( buildable == BA_H_REPEATER ) + { + for ( i = 1, tempent = g_entities + i; i < level.num_entities; i++, tempent++ ) + { + if( !Q_stricmp( tempent->classname, "team_human_reactor" ) ) + break; + } + + if( i >= level.num_entities ) + reason = IBE_RPTWARN; + } + if( BG_FindUniqueTestForBuildable( buildable ) ) { for ( i = 1, tempent = g_entities + i; i < level.num_entities; i++, tempent++ ) -- cgit