summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/cgame/cg_buildable.c45
-rw-r--r--src/game/bg_misc.c12
-rw-r--r--src/game/g_buildable.c4
3 files changed, 29 insertions, 32 deletions
diff --git a/src/cgame/cg_buildable.c b/src/cgame/cg_buildable.c
index 20a3de09..a91725fa 100644
--- a/src/cgame/cg_buildable.c
+++ b/src/cgame/cg_buildable.c
@@ -340,12 +340,14 @@ void CG_GhostBuildable( buildable_t buildable )
AngleVectors( angles, forward, NULL, NULL );
VectorCopy( tr.plane.normal, ent.axis[ 2 ] );
ProjectPointOnPlane( ent.axis[ 0 ], forward, ent.axis[ 2 ] );
+
if( !VectorNormalize( ent.axis[ 0 ] ) )
{
AngleVectors( angles, NULL, NULL, forward );
ProjectPointOnPlane( ent.axis[ 0 ], forward, ent.axis[ 2 ] );
VectorNormalize( ent.axis[ 0 ] );
}
+
CrossProduct( ent.axis[ 0 ], ent.axis[ 2 ], ent.axis[ 1 ] );
ent.axis[ 1 ][ 0 ] = -ent.axis[ 1 ][ 0 ];
ent.axis[ 1 ][ 1 ] = -ent.axis[ 1 ][ 1 ];
@@ -408,32 +410,29 @@ void CG_Buildable( centity_t *cent )
VectorCopy( es->angles, angles );
BG_FindBBoxForBuildable( es->modelindex, mins, maxs );
- if( surfNormal[ 2 ] != 1.0f )
+ AngleVectors( angles, forward, NULL, NULL );
+ VectorCopy( surfNormal, ent.axis[ 2 ] );
+ ProjectPointOnPlane( ent.axis[ 0 ], forward, ent.axis[ 2 ] );
+
+ if( !VectorNormalize( ent.axis[ 0 ] ) )
{
- AngleVectors( angles, forward, NULL, NULL );
- VectorCopy( surfNormal, ent.axis[ 2 ] );
+ AngleVectors( angles, NULL, NULL, forward );
ProjectPointOnPlane( ent.axis[ 0 ], forward, ent.axis[ 2 ] );
- if( !VectorNormalize( ent.axis[ 0 ] ) )
- {
- AngleVectors( angles, NULL, NULL, forward );
- ProjectPointOnPlane( ent.axis[ 0 ], forward, ent.axis[ 2 ] );
- VectorNormalize( ent.axis[ 0 ] );
- }
- CrossProduct( ent.axis[ 0 ], ent.axis[ 2 ], ent.axis[ 1 ] );
- ent.axis[ 1 ][ 0 ] = -ent.axis[ 1 ][ 0 ];
- ent.axis[ 1 ][ 1 ] = -ent.axis[ 1 ][ 1 ];
- ent.axis[ 1 ][ 2 ] = -ent.axis[ 1 ][ 2 ];
-
- VectorMA( ent.origin, -TRACE_DEPTH, surfNormal, end );
- VectorMA( ent.origin, 1.0f, surfNormal, start );
- CG_CapTrace( &tr, start, mins, maxs, end, es->number, MASK_PLAYERSOLID );
- VectorMA( ent.origin, tr.fraction * -TRACE_DEPTH, surfNormal, ent.origin );
-
- VectorCopy( ent.origin, ent.lightingOrigin );
- VectorCopy( ent.origin, ent.oldorigin ); // don't positionally lerp at all
+ VectorNormalize( ent.axis[ 0 ] );
}
- else
- AnglesToAxis( es->angles, ent.axis );
+
+ CrossProduct( ent.axis[ 0 ], ent.axis[ 2 ], ent.axis[ 1 ] );
+ ent.axis[ 1 ][ 0 ] = -ent.axis[ 1 ][ 0 ];
+ ent.axis[ 1 ][ 1 ] = -ent.axis[ 1 ][ 1 ];
+ ent.axis[ 1 ][ 2 ] = -ent.axis[ 1 ][ 2 ];
+
+ VectorMA( ent.origin, -TRACE_DEPTH, surfNormal, end );
+ VectorMA( ent.origin, 1.0f, surfNormal, start );
+ CG_CapTrace( &tr, start, mins, maxs, end, es->number, MASK_PLAYERSOLID );
+ VectorMA( ent.origin, tr.fraction * -TRACE_DEPTH, surfNormal, ent.origin );
+
+ VectorCopy( ent.origin, ent.lightingOrigin );
+ VectorCopy( ent.origin, ent.oldorigin ); // don't positionally lerp at all
ent.hModel = cg_buildables[ es->modelindex ].models[ 0 ];
diff --git a/src/game/bg_misc.c b/src/game/bg_misc.c
index f504957e..450bcd85 100644
--- a/src/game/bg_misc.c
+++ b/src/game/bg_misc.c
@@ -2265,12 +2265,12 @@ classAttributes_t bg_classList[ ] =
"BuilderLevel1", //char *classname;
"lucy", //char *modelname;
"angel", //char *skinname;
- { -15, -15, -20 }, //vec3_t mins;
- { 15, 15, 20 }, //vec3_t maxs;
- { 15, 15, 20 }, //vec3_t crouchmaxs;
- { -15, -15, -4 }, //vec3_t deadmins;
- { 15, 15, 4 }, //vec3_t deadmaxs;
- 12, 12, //int viewheight, crouchviewheight;
+ { -20, -20, -20 }, //vec3_t mins;
+ { 20, 20, 20 }, //vec3_t maxs;
+ { 20, 20, 20 }, //vec3_t crouchmaxs;
+ { -20, -20, -4 }, //vec3_t deadmins;
+ { 20, 20, 4 }, //vec3_t deadmaxs;
+ 0, 0, //int viewheight, crouchviewheight;
75, //int health;
10, //int armor;
SCA_CANJUMP|SCA_FOVWARPS|SCA_WALLCLIMBER, //int abilities;
diff --git a/src/game/g_buildable.c b/src/game/g_buildable.c
index 26de726d..5449237a 100644
--- a/src/game/g_buildable.c
+++ b/src/game/g_buildable.c
@@ -383,7 +383,6 @@ void DSpawn_Think( gentity_t *self )
if( ent->s.eType == ET_BUILDABLE || ent->s.number == ENTITYNUM_WORLD )
{
- G_Printf( "suiciding %d\n", ent->s.number == ENTITYNUM_WORLD );
G_Damage( self, NULL, NULL, NULL, NULL, 10000, 0, MOD_SUICIDE );
return;
}
@@ -1845,10 +1844,9 @@ gentity_t *G_buildItem( gentity_t *builder, buildable_t buildable, vec3_t origin
else
VectorSet( normal, 0.0f, 0.0f, 1.0f );
- VectorMA( origin, -10.0f, normal, built->s.pos.trBase );
+ VectorMA( origin, -50.0f, normal, built->s.pos.trDelta );
VectorCopy( normal, built->s.origin2 );
- /*VectorSet( built->s.origin2, 0.0f, 0.0f, 1.0f );*/
G_AddEvent( built, EV_BUILD_CONSTRUCT, BANIM_CONSTRUCT1 );