if (trace.fraction == 1)
break;
- //if (trace.plane.normal[2] > 0.7)
- // s->onground = true;
+ // this is only really needed for nogravityonground combined with gravityunaffectedbyticrate
+ // <LordHavoc> I'm pretty sure I commented it out solely because it seemed redundant
+ // this got commented out in a change that supposedly makes the code match QW better
+ // so if this is broken, maybe put it in an if(cls.protocol != PROTOCOL_QUAKEWORLD) block
+ if (trace.plane.normal[2] > 0.7)
+ s->onground = true;
t -= t * trace.fraction;
accelspeed = min(cl.movevars_accelerate * s->cmd.frametime * wishspeed, addspeed);
VectorMA(s->velocity, accelspeed, wishdir, s->velocity);
}
- if(cl.moveflags & MOVEFLAG_NOGRAVITYONGROUND)
- gravity = 0;
- else
- gravity = cl.movevars_gravity * cl.movevars_entgravity * s->cmd.frametime;
- if(cl.moveflags & MOVEFLAG_GRAVITYUNAFFECTEDBYTICRATE)
- s->velocity[2] -= gravity * 0.5f;
- else
- s->velocity[2] -= gravity;
+ gravity = cl.movevars_gravity * cl.movevars_entgravity * s->cmd.frametime;
+ if(!(cl.moveflags & MOVEFLAG_NOGRAVITYONGROUND))
+ {
+ if(cl.moveflags & MOVEFLAG_GRAVITYUNAFFECTEDBYTICRATE)
+ s->velocity[2] -= gravity * 0.5f;
+ else
+ s->velocity[2] -= gravity;
+ }
if (cls.protocol == PROTOCOL_QUAKEWORLD)
s->velocity[2] = 0;
if (VectorLength2(s->velocity))
CL_ClientMovement_Move(s);
- if(cl.moveflags & MOVEFLAG_GRAVITYUNAFFECTEDBYTICRATE)
- s->velocity[2] -= gravity * 0.5f;
+ if(!(cl.moveflags & MOVEFLAG_NOGRAVITYONGROUND) || !s->onground)
+ {
+ if(cl.moveflags & MOVEFLAG_GRAVITYUNAFFECTEDBYTICRATE)
+ s->velocity[2] -= gravity * 0.5f;
+ }
}
else
{
else
s->velocity[2] -= gravity;
CL_ClientMovement_Move(s);
- if(cl.moveflags & MOVEFLAG_GRAVITYUNAFFECTEDBYTICRATE)
- s->velocity[2] -= gravity * 0.5f;
+ if(!(cl.moveflags & MOVEFLAG_NOGRAVITYONGROUND) || !s->onground)
+ {
+ if(cl.moveflags & MOVEFLAG_GRAVITYUNAFFECTEDBYTICRATE)
+ s->velocity[2] -= gravity * 0.5f;
+ }
}
}
return 0;
gravity = 0;
- if(sv_gameplayfix_nogravityonground.integer)
- if((int)PRVM_serveredictfloat(ent, flags) & FL_ONGROUND)
- applygravity = false;
-
- if (applygravity)
+ if(applygravity)
{
- if (sv_gameplayfix_gravityunaffectedbyticrate.integer)
- {
- gravity = SV_Gravity(ent) * 0.5f;
- PRVM_serveredictvector(ent, velocity)[2] -= gravity;
- }
- else
+ gravity = SV_Gravity(ent);
+
+ if(!sv_gameplayfix_nogravityonground.integer || !((int)PRVM_serveredictfloat(ent, flags) & FL_ONGROUND))
{
- applygravity = false;
- PRVM_serveredictvector(ent, velocity)[2] -= SV_Gravity(ent);
+ if (sv_gameplayfix_gravityunaffectedbyticrate.integer)
+ PRVM_serveredictvector(ent, velocity)[2] -= gravity * 0.5f;
+ else
+ PRVM_serveredictvector(ent, velocity)[2] -= gravity;
}
}
+
blocked = 0;
VectorCopy(PRVM_serveredictvector(ent, velocity), original_velocity);
VectorCopy(PRVM_serveredictvector(ent, velocity), primal_velocity);
// LordHavoc: this came from QW and allows you to get out of water more easily
if (sv_gameplayfix_easierwaterjump.integer && ((int)PRVM_serveredictfloat(ent, flags) & FL_WATERJUMP) && !(blocked & 8))
VectorCopy(primal_velocity, PRVM_serveredictvector(ent, velocity));
- if (applygravity && !((int)PRVM_serveredictfloat(ent, flags) & FL_ONGROUND))
- PRVM_serveredictvector(ent, velocity)[2] -= gravity;
+
+ if(applygravity)
+ {
+ if(!sv_gameplayfix_nogravityonground.integer || !((int)PRVM_serveredictfloat(ent, flags) & FL_ONGROUND))
+ {
+ if (sv_gameplayfix_gravityunaffectedbyticrate.integer)
+ PRVM_serveredictvector(ent, velocity)[2] -= gravity * 0.5f;
+ }
+ }
+
return blocked;
}