From 2d72ce3837ec27364107a13c42ac21a31775621e Mon Sep 17 00:00:00 2001 From: havoc Date: Wed, 25 Feb 2004 18:41:19 +0000 Subject: [PATCH] MOVETYPE_BOUNCE change: an explosion above gibs will now cause them to bounce into the air, rather than skidding to a halt immediately like they were doing git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@3925 d7cf8633-e32d-0410-b094-e92efae38249 --- sv_phys.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sv_phys.c b/sv_phys.c index 62b1ff62..66eec8e2 100644 --- a/sv_phys.c +++ b/sv_phys.c @@ -1288,9 +1288,11 @@ void SV_Physics_Toss (edict_t *ent) } else if (ent->v->movetype == MOVETYPE_BOUNCE) { + float d; ClipVelocity (ent->v->velocity, trace.plane.normal, ent->v->velocity, 1.5); // LordHavoc: fixed grenades not bouncing when fired down a slope - if (trace.plane.normal[2] > 0.7 && DotProduct(trace.plane.normal, ent->v->velocity) < 60) + d = DotProduct(trace.plane.normal, ent->v->velocity); + if (trace.plane.normal[2] > 0.7 && fabs(d) < 60) { ent->v->flags = (int)ent->v->flags | FL_ONGROUND; ent->v->groundentity = EDICT_TO_PROG(trace.ent); -- 2.39.2