Implementing
1. Create a cvar called sv_gameplayfix_grenadebouncedownslopes and register it. A value of 0 is original Quake behavior obviously.
2. Open sv_physics.c and find this:
Code: Select all
// stop if on ground
if (trace.plane.normal[2] > 0.7)
{
if (ent->v.velocity[2] < 60 || ent->v.movetype != MOVETYPE_BOUNCE)
{
ent->v.flags = (int)ent->v.flags | FL_ONGROUND;
ent->v.groundentity = EDICT_TO_PROG(trace.ent);
VectorCopy (vec3_origin, ent->v.velocity);
VectorCopy (vec3_origin, ent->v.avelocity);
}
}
Code: Select all
// stop if on ground
if (trace.plane.normal[2] > 0.7)
{
int stop_moving = false;
if (sv_gameplayfix_grenadebouncedownslopes.value)
{
if (DotProduct(trace.plane.normal, ent->v.velocity) < 60)
stop_moving = true;
}
else
{
if (ent->v.velocity[2] < 60 || ent->v.movetype != MOVETYPE_BOUNCE)
stop_moving = true;
}
if (stop_moving)
{
ent->v.flags = (int)ent->v.flags | FL_ONGROUND;
ent->v.groundentity = EDICT_TO_PROG(trace.ent);
VectorCopy (vec3_origin, ent->v.velocity);
VectorCopy (vec3_origin, ent->v.avelocity);
}
}