mirror of
https://github.com/ReactionQuake3/reaction.git
synced 2024-11-24 05:01:24 +00:00
Mostly fixed dropeweapon not getting stuck in walls - NiceAss
This commit is contained in:
parent
1cf37f2ff5
commit
92bf99387e
1 changed files with 43 additions and 31 deletions
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue