Just walking on the moon
Code to be Deleted or Commented out
Code to be Added or Changed
g_active.c
Find the ClientThink_real function, and look for this line:
client->ps.gravity = g_gravity.value;
This tells the game what value to set the gravity based on its server cvar. We are just going to remove or comment out the original line, and make a simple change, like this:
//client->ps.gravity = g_gravity.value;
client->ps.gravity = g_gravity.value * 0.25;
And now the gravity is only a quarter of it's usual value, it has the effect ingame just like moon walking ;)
Here's a little extra coding, same function, same place, only this will leave the original gravity value, but will cause you to jump and float down, try this:
client->ps.gravity = g_gravity.value;
if (client->ps.velocity > 0) { //moving upwards
client->ps.gravity = g_gravity.value * 0.50; //half gravity
} else { //moving down
client->ps.gravity = g_gravity.value * 0.25; //quarter gravity
}
It will alter the a slightly higher gravity as you bounce upwards, but then lower gravity for a slower fall back to the ground. |