summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/game/g_buildable.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/game/g_buildable.c b/src/game/g_buildable.c
index 7ae279d7..870fa6fe 100644
--- a/src/game/g_buildable.c
+++ b/src/game/g_buildable.c
@@ -1235,6 +1235,16 @@ qboolean AHovel_Blocked( gentity_t *hovel, gentity_t *player, qboolean provideEx
VectorMaxComponent( hovelMaxs ) * M_ROOT3 + 1.0f;
VectorMA( hovel->s.origin, displacement, forward, origin );
+
+ VectorCopy( hovel->s.origin, start );
+ VectorCopy( origin, end );
+
+ // see if there's something between the hovel and its exit
+ // (eg built right up against a wall)
+ trap_Trace( &tr, start, NULL, NULL, end, player->s.number, MASK_PLAYERSOLID );
+ if( tr.fraction < 1.0f )
+ return qtrue;
+
vectoangles( forward, angles );
VectorMA( origin, HOVEL_TRACE_DEPTH, normal, start );
@@ -3081,7 +3091,7 @@ itemBuildError_t G_CanBuild( gentity_t *ent, buildable_t buildable, int distance
//this assumes the adv builder is the biggest thing that'll use the hovel
BG_ClassBoundingBox( PCL_ALIEN_BUILDER0_UPG, builderMins, builderMaxs, NULL, NULL, NULL );
- if( APropHovel_Blocked( angles, origin, normal, ent ) )
+ if( APropHovel_Blocked( origin, angles, normal, ent ) )
reason = IBE_HOVELEXIT;
}