summaryrefslogtreecommitdiff
path: root/src/game
diff options
context:
space:
mode:
Diffstat (limited to 'src/game')
-rw-r--r--src/game/bg_misc.c35
-rw-r--r--src/game/bg_public.h2
-rw-r--r--src/game/g_buildable.c21
3 files changed, 55 insertions, 3 deletions
diff --git a/src/game/bg_misc.c b/src/game/bg_misc.c
index 322aaa3b..fd8b87d7 100644
--- a/src/game/bg_misc.c
+++ b/src/game/bg_misc.c
@@ -67,6 +67,7 @@ buildableAttributes_t bg_buildableList[ ] =
qfalse, //qboolean creepTest;
ASPAWN_CREEPSIZE, //int creepSize;
qfalse, //qboolean dccTest;
+ qfalse, //qboolean transparentTest;
qfalse //qboolean reactorTest;
},
{
@@ -102,6 +103,7 @@ buildableAttributes_t bg_buildableList[ ] =
qtrue, //qboolean creepTest;
BARRICADE_CREEPSIZE, //int creepSize;
qfalse, //qboolean dccTest;
+ qfalse, //qboolean transparentTest;
qfalse //qboolean reactorTest;
},
{
@@ -137,6 +139,7 @@ buildableAttributes_t bg_buildableList[ ] =
qtrue, //qboolean creepTest;
BOOSTER_CREEPSIZE, //int creepSize;
qfalse, //qboolean dccTest;
+ qtrue, //qboolean transparentTest;
qfalse //qboolean reactorTest;
},
{
@@ -172,6 +175,7 @@ buildableAttributes_t bg_buildableList[ ] =
qtrue, //qboolean creepTest;
ACIDTUBE_CREEPSIZE, //int creepSize;
qfalse, //qboolean dccTest;
+ qfalse, //qboolean transparentTest;
qfalse //qboolean reactorTest;
},
{
@@ -207,6 +211,7 @@ buildableAttributes_t bg_buildableList[ ] =
qtrue, //qboolean creepTest;
HIVE_CREEPSIZE, //int creepSize;
qfalse, //qboolean dccTest;
+ qfalse, //qboolean transparentTest;
qfalse //qboolean reactorTest;
},
{
@@ -242,6 +247,7 @@ buildableAttributes_t bg_buildableList[ ] =
qtrue, //qboolean creepTest;
TRAPPER_CREEPSIZE, //int creepSize;
qfalse, //qboolean dccTest;
+ qtrue, //qboolean transparentTest;
qfalse //qboolean reactorTest;
},
{
@@ -277,6 +283,7 @@ buildableAttributes_t bg_buildableList[ ] =
qfalse, //qboolean creepTest;
OVERMIND_CREEPSIZE, //int creepSize;
qfalse, //qboolean dccTest;
+ qfalse, //qboolean transparentTest;
qtrue //qboolean reactorTest;
},
{
@@ -312,6 +319,7 @@ buildableAttributes_t bg_buildableList[ ] =
qtrue, //qboolean creepTest;
HOVEL_CREEPSIZE, //int creepSize;
qfalse, //qboolean dccTest;
+ qfalse, //qboolean transparentTest;
qtrue //qboolean reactorTest;
},
{
@@ -347,6 +355,7 @@ buildableAttributes_t bg_buildableList[ ] =
qfalse, //qboolean creepTest;
0, //int creepSize;
qfalse, //qboolean dccTest;
+ qtrue, //qboolean transparentTest;
qfalse //qboolean reactorTest;
},
{
@@ -382,6 +391,7 @@ buildableAttributes_t bg_buildableList[ ] =
qfalse, //qboolean creepTest;
0, //int creepSize;
qfalse, //qboolean dccTest;
+ qtrue, //qboolean transparentTest;
qfalse //qboolean reactorTest;
},
{
@@ -419,6 +429,7 @@ buildableAttributes_t bg_buildableList[ ] =
qfalse, //qboolean creepTest;
0, //int creepSize;
qfalse, //qboolean dccTest;
+ qtrue, //qboolean transparentTest;
qfalse //qboolean reactorTest;
},
{
@@ -454,6 +465,7 @@ buildableAttributes_t bg_buildableList[ ] =
qfalse, //qboolean creepTest;
0, //int creepSize;
qtrue, //qboolean dccTest;
+ qtrue, //qboolean transparentTest;
qfalse //qboolean reactorTest;
},
{
@@ -489,6 +501,7 @@ buildableAttributes_t bg_buildableList[ ] =
qfalse, //qboolean creepTest;
0, //int creepSize;
qfalse, //qboolean dccTest;
+ qfalse, //qboolean transparentTest;
qfalse //qboolean reactorTest;
},
{
@@ -524,6 +537,7 @@ buildableAttributes_t bg_buildableList[ ] =
qfalse, //qboolean creepTest;
0, //int creepSize;
qfalse, //qboolean dccTest;
+ qfalse, //qboolean transparentTest;
qfalse //qboolean reactorTest;
},
{
@@ -559,6 +573,7 @@ buildableAttributes_t bg_buildableList[ ] =
qfalse, //qboolean creepTest;
0, //int creepSize;
qfalse, //qboolean dccTest;
+ qfalse, //qboolean transparentTest;
qtrue //qboolean reactorTest;
},
{
@@ -594,6 +609,7 @@ buildableAttributes_t bg_buildableList[ ] =
qfalse, //qboolean creepTest;
0, //int creepSize;
qfalse, //qboolean dccTest;
+ qfalse, //qboolean transparentTest;
qfalse //qboolean reactorTest;
}
};
@@ -1299,6 +1315,25 @@ static buildableAttributeOverrides_t *BG_FindOverrideForBuildable( int bclass )
}
/*
+==============
+BG_FindTransparentTestForBuildable
+==============
+*/
+qboolean BG_FindTransparentTestForBuildable( int bclass )
+{
+ int i;
+
+ for( i = 0; i < bg_numBuildables; i++ )
+ {
+ if( bg_buildableList[ i ].buildNum == bclass )
+ {
+ return bg_buildableList[ i ].transparentTest;
+ }
+ }
+ return qfalse;
+}
+
+/*
======================
BG_ParseBuildableFile
diff --git a/src/game/bg_public.h b/src/game/bg_public.h
index 36e01910..877b8b8c 100644
--- a/src/game/bg_public.h
+++ b/src/game/bg_public.h
@@ -1019,6 +1019,7 @@ typedef struct
int creepSize;
qboolean dccTest;
+ qboolean transparentTest;
qboolean reactorTest;
} buildableAttributes_t;
@@ -1146,6 +1147,7 @@ int BG_FindCreepTestForBuildable( int bclass );
int BG_FindCreepSizeForBuildable( int bclass );
int BG_FindDCCTestForBuildable( int bclass );
int BG_FindUniqueTestForBuildable( int bclass );
+qboolean BG_FindTransparentTestForBuildable( int bclass );
void BG_InitBuildableOverrides( void );
int BG_FindClassNumForName( char *name );
diff --git a/src/game/g_buildable.c b/src/game/g_buildable.c
index abe39448..5aba0ece 100644
--- a/src/game/g_buildable.c
+++ b/src/game/g_buildable.c
@@ -908,6 +908,9 @@ Think function for Alien Barricade
*/
void ABarricade_Think( gentity_t *self )
{
+
+ self->powered = G_IsOvermindBuilt( );
+
//if there is no creep nearby die
if( !G_FindCreep( self ) )
{
@@ -980,6 +983,8 @@ void AAcidTube_Think( gentity_t *self )
int i, num;
gentity_t *enemy;
+ self->powered = G_IsOvermindBuilt( );
+
VectorAdd( self->s.origin, range, maxs );
VectorSubtract( self->s.origin, range, mins );
@@ -1041,6 +1046,8 @@ void AHive_Think( gentity_t *self )
gentity_t *enemy;
vec3_t dirToTarget;
+ self->powered = G_IsOvermindBuilt( );
+
self->nextthink = level.time + BG_FindNextThinkForBuildable( self->s.modelindex );
VectorAdd( self->s.origin, range, maxs );
@@ -1245,6 +1252,7 @@ Think for alien hovel
*/
void AHovel_Think( gentity_t *self )
{
+ self->powered = G_IsOvermindBuilt( );
if( self->spawned )
{
if( self->active )
@@ -1517,6 +1525,8 @@ void ATrapper_Think( gentity_t *self )
int range = BG_FindRangeForBuildable( self->s.modelindex );
int firespeed = BG_FindFireSpeedForBuildable( self->s.modelindex );
+ self->powered = G_IsOvermindBuilt( );
+
G_CreepSlow( self );
self->nextthink = level.time + BG_FindNextThinkForBuildable( self->s.modelindex );
@@ -2305,8 +2315,8 @@ void HSpawn_Think( gentity_t *self )
{
gentity_t *ent;
- //make sure we have power
- self->powered = G_FindPower( self );
+ // spawns work without power
+ self->powered = qtrue;
if( self->spawned )
{
@@ -3218,7 +3228,12 @@ static gentity_t *G_Build( gentity_t *builder, buildable_t buildable, vec3_t ori
if( built->s.generic1 < 0 )
built->s.generic1 = 0;
- if( ( built->powered = G_FindPower( built ) ) )
+ if( BG_FindTeamForBuildable( built->s.modelindex ) == PTE_ALIENS )
+ {
+ built->powered = qtrue;
+ built->s.generic1 |= B_POWERED_TOGGLEBIT;
+ }
+ else if( ( built->powered = G_FindPower( built ) ) )
built->s.generic1 |= B_POWERED_TOGGLEBIT;
if( ( built->dcced = G_FindDCC( built ) ) )