}
else if (ent->fields.server->movetype == MOVETYPE_BOUNCE)
{
- float d;
+ float d, ent_gravity;
+ prvm_eval_t *val;
ClipVelocity (ent->fields.server->velocity, trace.plane.normal, ent->fields.server->velocity, 1.5);
// LordHavoc: fixed grenades not bouncing when fired down a slope
+ val = PRVM_EDICTFIELDVALUE(ent, prog->fieldoffsets.gravity);
+ if (val!=0 && val->_float)
+ ent_gravity = val->_float;
+ else
+ ent_gravity = 1.0;
if (sv_gameplayfix_grenadebouncedownslopes.integer)
{
d = DotProduct(trace.plane.normal, ent->fields.server->velocity);
- if (trace.plane.normal[2] > 0.7 && fabs(d) < sv_gravity.value * (60.0 / 800.0))
+ if (trace.plane.normal[2] > 0.7 && fabs(d) < sv_gravity.value * (60.0 / 800.0) * ent_gravity)
{
ent->fields.server->flags = (int)ent->fields.server->flags | FL_ONGROUND;
ent->fields.server->groundentity = PRVM_EDICT_TO_PROG(trace.ent);
}
else
{
- if (trace.plane.normal[2] > 0.7 && ent->fields.server->velocity[2] < sv_gravity.value * (60.0 / 800.0))
+ if (trace.plane.normal[2] > 0.7 && ent->fields.server->velocity[2] < sv_gravity.value * (60.0 / 800.0) * ent_gravity)
{
ent->fields.server->flags = (int)ent->fields.server->flags | FL_ONGROUND;
ent->fields.server->groundentity = PRVM_EDICT_TO_PROG(trace.ent);
}
// don't run physics here if running asynchronously
- if (host_client->clmovement_skipphysicsframes <= 0)
+ if (host_client->clmovement_inputtimeout <= 0)
{
SV_ClientThink();
//host_client->cmd.time = max(host_client->cmd.time, sv.time);
case MOVETYPE_WALK:
SV_RunThink (ent);
// don't run physics here if running asynchronously
- if (host_client->clmovement_skipphysicsframes <= 0)
+ if (host_client->clmovement_inputtimeout <= 0)
SV_WalkMove (ent);
break;
case MOVETYPE_TOSS:
// decrement the countdown variable used to decide when to go back to
// synchronous physics
- if (host_client->clmovement_skipphysicsframes > 0)
- host_client->clmovement_skipphysicsframes--;
+ if (host_client->clmovement_inputtimeout > sv.frametime)
+ host_client->clmovement_inputtimeout -= sv.frametime;
+ else
+ host_client->clmovement_inputtimeout = 0;
SV_CheckVelocity (ent);