From c7d3bd75523726fc4f5230a9c23b5f31537fc5a8 Mon Sep 17 00:00:00 2001 From: Tim Angus Date: Sun, 31 Aug 2003 01:18:40 +0000 Subject: * Fixed hovel problems --- src/game/g_active.c | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) (limited to 'src/game/g_active.c') diff --git a/src/game/g_active.c b/src/game/g_active.c index fc4b4ea3..df67d1a3 100644 --- a/src/game/g_active.c +++ b/src/game/g_active.c @@ -1056,31 +1056,23 @@ void ClientThink_real( gentity_t *ent ) if( client->ps.stats[ STAT_STATE ] & SS_HOVELING ) { - gentity_t *hovel = client->infestBody; - vec3_t forward, newOrigin, newAngles; - trace_t tr; + gentity_t *hovel = client->hovel; + vec3_t newOrigin, newAngles; vec3_t mins, maxs; BG_FindBBoxForClass( client->ps.stats[ STAT_PCLASS ], mins, maxs, NULL, NULL, NULL ); - AngleVectors( hovel->s.angles, forward, NULL, NULL ); - VectorInverse( forward ); - - VectorMA( hovel->s.origin, 95.0f, forward, newOrigin ); - vectoangles( forward, newAngles ); - - VectorMA( newOrigin, 1.0f, hovel->s.origin2, newOrigin ); - - trap_Trace( &tr, newOrigin, mins, maxs, newOrigin, 0, MASK_PLAYERSOLID ); - //only let the player out if there is room - if( tr.fraction == 1.0 ) + if( !AHovel_Blocked( hovel->s.angles, hovel->s.origin, hovel->s.origin2, + mins, maxs, 0, newOrigin, newAngles ) ) { //prevent lerping - ent->client->ps.eFlags ^= EF_TELEPORT_BIT; - + client->ps.eFlags ^= EF_TELEPORT_BIT; + client->ps.eFlags &= ~EF_NODRAW; + G_SetOrigin( ent, newOrigin ); - VectorCopy( newOrigin, ent->client->ps.origin ); + VectorCopy( newOrigin, client->ps.origin ); + VectorCopy( vec3_origin, client->ps.velocity ); SetClientViewAngle( ent, newAngles ); //client leaves hovel -- cgit