Mostly fixed dropeweapon not getting stuck in walls - NiceAss

This commit is contained in:
Bryce Hutchings 2001-11-13 05:18:59 +00:00
parent 1cf37f2ff5
commit 92bf99387e

View file

@ -1009,6 +1009,8 @@ gentity_t *dropWeapon( gentity_t *ent, gitem_t *item, float angle, int xr_flags
vec3_t angles;
vec3_t origin;
//int throwheight;
vec3_t mins, maxs;
trace_t tr;
VectorCopy( ent->s.pos.trBase, origin );
VectorCopy( ent->s.apos.trBase, angles );
@ -1023,6 +1025,16 @@ gentity_t *dropWeapon( gentity_t *ent, gitem_t *item, float angle, int xr_flags
//Elder: don't toss from the head, but from the "waist"
origin[2] += 10; // (ent->client->ps.viewheight / 2);
VectorMA( origin, 5, velocity, origin ); // 14 34 10
// Set temporary bounding box for trace
VectorSet (mins, -ITEM_RADIUS, -ITEM_RADIUS, -ITEM_RADIUS);
VectorSet (maxs, ITEM_RADIUS, ITEM_RADIUS, ITEM_RADIUS);
// NiceAss: Check if the new location starts in a solid.
trap_Trace( &tr, origin, mins, maxs, origin, ent->s.number, MASK_SOLID );
if (tr.startsolid == qtrue)
VectorMA( origin, -7, velocity, origin ); // -5 won't work (hint: it should work). Only -7 or less will..
// snap to integer coordinates for more efficient network bandwidth usage
SnapVector( origin);