diff options
Diffstat (limited to 'src/game')
-rw-r--r-- | src/game/bg_misc.c | 39 | ||||
-rw-r--r-- | src/game/bg_public.h | 2 | ||||
-rw-r--r-- | src/game/g_buildable.c | 2 |
3 files changed, 42 insertions, 1 deletions
diff --git a/src/game/bg_misc.c b/src/game/bg_misc.c index 7512c19c..97ef2c6a 100644 --- a/src/game/bg_misc.c +++ b/src/game/bg_misc.c @@ -41,6 +41,7 @@ buildableAttributes_t bg_buildableList[ ] = ( 1 << WP_ABUILD )|( 1 << WP_ABUILD2 ), //weapon_t buildWeapon; BANIM_IDLE1, //int idleAnim; 100, //int nextthink; + qfalse, //qboolean usable; 0, //int turretRange; 0, //int turretFireSpeed; WP_NONE, //weapon_t turretProjType; @@ -72,6 +73,7 @@ buildableAttributes_t bg_buildableList[ ] = ( 1 << WP_ABUILD )|( 1 << WP_ABUILD2 ), //weapon_t buildWeapon; BANIM_IDLE1, //int idleAnim; 100, //int nextthink; + qfalse, //qboolean usable; 0, //int turretRange; 0, //int turretFireSpeed; WP_NONE, //weapon_t turretProjType; @@ -103,6 +105,7 @@ buildableAttributes_t bg_buildableList[ ] = ( 1 << WP_ABUILD )|( 1 << WP_ABUILD2 ), //weapon_t buildWeapon; BANIM_IDLE1, //int idleAnim; 100, //int nextthink; + qfalse, //qboolean usable; 0, //int turretRange; 0, //int turretFireSpeed; WP_NONE, //weapon_t turretProjType; @@ -134,6 +137,7 @@ buildableAttributes_t bg_buildableList[ ] = ( 1 << WP_ABUILD )|( 1 << WP_ABUILD2 ), //weapon_t buildWeapon; BANIM_IDLE1, //int idleAnim; 500, //int nextthink; + qfalse, //qboolean usable; 0, //int turretRange; 0, //int turretFireSpeed; WP_NONE, //weapon_t turretProjType; @@ -165,6 +169,7 @@ buildableAttributes_t bg_buildableList[ ] = ( 1 << WP_ABUILD )|( 1 << WP_ABUILD2 ), //weapon_t buildWeapon; BANIM_IDLE1, //int idleAnim; 100, //int nextthink; + qfalse, //qboolean usable; TRAPPER_RANGE, //int turretRange; TRAPPER_REPEAT, //int turretFireSpeed; WP_LOCKBLOB_LAUNCHER, //weapon_t turretProjType; @@ -196,6 +201,7 @@ buildableAttributes_t bg_buildableList[ ] = ( 1 << WP_ABUILD )|( 1 << WP_ABUILD2 ), //weapon_t buildWeapon; BANIM_IDLE1, //int idleAnim; OVERMIND_ATTACK_REPEAT,//int nextthink; + qfalse, //qboolean usable; 0, //int turretRange; 0, //int turretFireSpeed; WP_NONE, //weapon_t turretProjType; @@ -227,6 +233,7 @@ buildableAttributes_t bg_buildableList[ ] = ( 1 << WP_ABUILD )|( 1 << WP_ABUILD2 ), //weapon_t buildWeapon; BANIM_IDLE1, //int idleAnim; 150, //int nextthink; + qtrue, //qboolean usable; 0, //int turretRange; 0, //int turretFireSpeed; WP_NONE, //weapon_t turretProjType; @@ -258,6 +265,7 @@ buildableAttributes_t bg_buildableList[ ] = ( 1 << WP_ABUILD )|( 1 << WP_ABUILD2 ), //weapon_t buildWeapon; BANIM_IDLE1, //int idleAnim; -1, //int nextthink; + qtrue, //qboolean usable; 0, //int turretRange; 0, //int turretFireSpeed; WP_NONE, //weapon_t turretProjType; @@ -289,6 +297,7 @@ buildableAttributes_t bg_buildableList[ ] = ( 1 << WP_HBUILD )|( 1 << WP_HBUILD2 ), //weapon_t buildWeapon; BANIM_IDLE1, //int idleAnim; 100, //int nextthink; + qfalse, //qboolean usable; 0, //int turretRange; 0, //int turretFireSpeed; WP_NONE, //weapon_t turretProjType; @@ -320,6 +329,7 @@ buildableAttributes_t bg_buildableList[ ] = ( 1 << WP_HBUILD )|( 1 << WP_HBUILD2 ), //weapon_t buildWeapon; BANIM_IDLE1, //int idleAnim; 100, //int nextthink; + qfalse, //qboolean usable; 0, //int turretRange; 0, //int turretFireSpeed; WP_NONE, //weapon_t turretProjType; @@ -351,6 +361,7 @@ buildableAttributes_t bg_buildableList[ ] = ( 1 << WP_HBUILD2 ), //weapon_t buildWeapon; BANIM_IDLE1, //int idleAnim; 100, //int nextthink; + qfalse, //qboolean usable; 0, //int turretRange; 0, //int turretFireSpeed; WP_NONE, //weapon_t turretProjType; @@ -384,6 +395,7 @@ buildableAttributes_t bg_buildableList[ ] = ( 1 << WP_HBUILD )|( 1 << WP_HBUILD2 ), //weapon_t buildWeapon; BANIM_IDLE1, //int idleAnim; 50, //int nextthink; + qfalse, //qboolean usable; MGTURRET_RANGE, //int turretRange; MGTURRET_REPEAT, //int turretFireSpeed; WP_MACHINEGUN, //weapon_t turretProjType; @@ -415,6 +427,7 @@ buildableAttributes_t bg_buildableList[ ] = ( 1 << WP_HBUILD2 ), //weapon_t buildWeapon; BANIM_IDLE1, //int idleAnim; 150, //int nextthink; + qfalse, //qboolean usable; TESLAGEN_RANGE, //int turretRange; TESLAGEN_REPEAT, //int turretFireSpeed; WP_TESLAGEN, //weapon_t turretProjType; @@ -446,6 +459,7 @@ buildableAttributes_t bg_buildableList[ ] = ( 1 << WP_HBUILD2 ), //weapon_t buildWeapon; BANIM_IDLE1, //int idleAnim; 100, //int nextthink; + qfalse, //qboolean usable; 0, //int turretRange; 0, //int turretFireSpeed; WP_NONE, //weapon_t turretProjType; @@ -477,6 +491,7 @@ buildableAttributes_t bg_buildableList[ ] = ( 1 << WP_HBUILD )|( 1 << WP_HBUILD2 ), //weapon_t buildWeapon; BANIM_IDLE1, //int idleAnim; 100, //int nextthink; + qtrue, //qboolean usable; 0, //int turretRange; 0, //int turretFireSpeed; WP_NONE, //weapon_t turretProjType; @@ -508,6 +523,7 @@ buildableAttributes_t bg_buildableList[ ] = ( 1 << WP_HBUILD )|( 1 << WP_HBUILD2 ), //weapon_t buildWeapon; BANIM_IDLE1, //int idleAnim; 100, //int nextthink; + qtrue, //qboolean usable; 0, //int turretRange; 0, //int turretFireSpeed; WP_NONE, //weapon_t turretProjType; @@ -539,6 +555,7 @@ buildableAttributes_t bg_buildableList[ ] = ( 1 << WP_HBUILD )|( 1 << WP_HBUILD2 ), //weapon_t buildWeapon; BANIM_IDLE1, //int idleAnim; -1, //int nextthink; + qtrue, //qboolean usable; 0, //int turretRange; 0, //int turretFireSpeed; WP_NONE, //weapon_t turretProjType; @@ -570,6 +587,7 @@ buildableAttributes_t bg_buildableList[ ] = ( 1 << WP_HBUILD )|( 1 << WP_HBUILD2 ), //weapon_t buildWeapon; BANIM_IDLE1, //int idleAnim; 100, //int nextthink; + qtrue, //qboolean usable; 0, //int turretRange; 0, //int turretFireSpeed; WP_NONE, //weapon_t turretProjType; @@ -601,6 +619,7 @@ buildableAttributes_t bg_buildableList[ ] = ( 1 << WP_HBUILD2 ), //weapon_t buildWeapon; BANIM_IDLE1, //int idleAnim; 100, //int nextthink; + qfalse, //qboolean usable; 0, //int turretRange; 0, //int turretFireSpeed; WP_NONE, //weapon_t turretProjType; @@ -1024,6 +1043,26 @@ int BG_FindNextThinkForBuildable( int bclass ) /* ============== +BG_FindUsableForBuildable +============== +*/ +qboolean BG_FindUsableForBuildable( int bclass ) +{ + int i; + + for( i = 0; i < bg_numBuildables; i++ ) + { + if( bg_buildableList[ i ].buildNum == bclass ) + { + return bg_buildableList[ i ].usable; + } + } + + return qfalse; +} + +/* +============== BG_FindFireSpeedForBuildable ============== */ diff --git a/src/game/bg_public.h b/src/game/bg_public.h index 890c1b88..20b97cf7 100644 --- a/src/game/bg_public.h +++ b/src/game/bg_public.h @@ -882,6 +882,7 @@ typedef struct int idleAnim; int nextthink; + qboolean usable; int turretRange; int turretFireSpeed; @@ -994,6 +995,7 @@ int BG_FindTeamForBuildable( int bclass ); weapon_t BG_FindBuildWeaponForBuildable( int bclass ); int BG_FindAnimForBuildable( int bclass ); int BG_FindNextThinkForBuildable( int bclass ); +qboolean BG_FindUsableForBuildable( int bclass ); int BG_FindRangeForBuildable( int bclass ); int BG_FindFireSpeedForBuildable( int bclass ); weapon_t BG_FindProjTypeForBuildable( int bclass ); diff --git a/src/game/g_buildable.c b/src/game/g_buildable.c index 867804fd..f64d7307 100644 --- a/src/game/g_buildable.c +++ b/src/game/g_buildable.c @@ -2078,7 +2078,7 @@ gentity_t *G_buildItem( gentity_t *builder, buildable_t buildable, vec3_t origin if( built->powered = findPower( built ) ) built->s.generic1 |= B_POWERED_TOGGLEBIT; - if( built->dcced = findDCC( built ) ) + if( built->dcced = findDCC( built ) ) built->s.generic1 |= B_DCCED_TOGGLEBIT; VectorCopy( normal, built->s.origin2 ); |