diff options
author | IronClawTrem <louie.nutman@gmail.com> | 2020-03-14 19:15:57 +0000 |
---|---|---|
committer | IronClawTrem <louie.nutman@gmail.com> | 2020-03-14 19:15:57 +0000 |
commit | ab3753cd67f614786efc5bf89db6e317b83a197b (patch) | |
tree | e594891823d4c09e67aff0933f6608ce1e6e7145 /src/cgame | |
parent | b45e37aa3a650272b70583d0b9747f1ee3b5ab0e (diff) |
add barricade shrink mechanic
Diffstat (limited to 'src/cgame')
-rw-r--r-- | src/cgame/cg_buildable.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/cgame/cg_buildable.c b/src/cgame/cg_buildable.c index e678ebd..40736e6 100644 --- a/src/cgame/cg_buildable.c +++ b/src/cgame/cg_buildable.c @@ -899,6 +899,7 @@ static void CG_BuildableStatusDisplay( centity_t *cent ) qboolean visible = qfalse; vec3_t mins, maxs; entityState_t *hit; + int anim; if( BG_FindTeamForBuildable( es->modelindex ) == BIT_ALIENS ) bs = &cgs.alienBuildStat; @@ -917,6 +918,12 @@ static void CG_BuildableStatusDisplay( centity_t *cent ) // trace for center point BG_FindBBoxForBuildable( es->modelindex, mins, maxs ); + // hack for shrunken barricades + anim = es->torsoAnim & ~( ANIM_FORCEBIT | ANIM_TOGGLEBIT ); + if( es->modelindex == BA_A_BARRICADE && + ( anim == BANIM_DESTROYED || !( es->generic1 & B_SPAWNED_TOGGLEBIT ) ) ) + maxs[ 2 ] = (int)( maxs[ 2 ] * BARRICADE_SHRINKPROP ); + VectorCopy( cent->lerpOrigin, origin ); // center point |