summaryrefslogtreecommitdiff
path: root/src/game/g_active.c
diff options
context:
space:
mode:
authorTim Angus <tim@ngus.net>2003-08-31 01:18:40 +0000
committerTim Angus <tim@ngus.net>2003-08-31 01:18:40 +0000
commitc7d3bd75523726fc4f5230a9c23b5f31537fc5a8 (patch)
tree5fcec7f1c10997cf640393271ae18c5522ed3c82 /src/game/g_active.c
parent703dcc641a188c128dc5acb7bfc6d7b8333bdd35 (diff)
* Fixed hovel problems
Diffstat (limited to 'src/game/g_active.c')
-rw-r--r--src/game/g_active.c26
1 files changed, 9 insertions, 17 deletions
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