summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristopher Schwarz <lakitu7@gmail.com>2009-10-03 12:26:34 +0000
committerTim Angus <tim@ngus.net>2013-01-03 00:15:57 +0000
commit54249920dea34a3b848e91c106eafbbf9e6cfe45 (patch)
tree72fdda1204293f156bf49fbcbc736556f836dd0a /src
parent6f56815bdb0ba0b37d4afcd4c2cac3f4ddd1846d (diff)
* Fix the order of the arguments to APropHovel_Blocked so that it's not completely broken. Mysterious successes and failures of allowed hovel placement should no longer occur.
* Prevent hovels allowing grangers to get outside the map, once again (thanks Rezyn)
Diffstat (limited to 'src')
-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;
}