- ent->v.flags = (int)ent->v.flags | FL_ONGROUND;
- ent->v.groundentity = EDICT_TO_PROG(trace.ent);
- VectorClear (ent->v.velocity);
- VectorClear (ent->v.avelocity);
+ 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)
+ {
+ ent->v.flags = (int)ent->v.flags | FL_ONGROUND;
+ ent->v.groundentity = EDICT_TO_PROG(trace.ent);
+ VectorClear (ent->v.velocity);
+ VectorClear (ent->v.avelocity);
+ }
+ else
+ ent->v.flags = (int)ent->v.flags & ~FL_ONGROUND;