From: havoc Date: Wed, 25 Feb 2004 18:41:19 +0000 (+0000) Subject: MOVETYPE_BOUNCE change: an explosion above gibs will now cause them to bounce into... X-Git-Tag: xonotic-v0.1.0preview~6070 X-Git-Url: https://de.git.xonotic.org/?a=commitdiff_plain;h=2d72ce3837ec27364107a13c42ac21a31775621e;p=xonotic%2Fdarkplaces.git 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 --- 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);