Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjust gib's velocity limit according to sv_maxvelocity #846

Merged
merged 3 commits into from
Jul 14, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions regamedll/dlls/gib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,18 @@ void CGib::LimitVelocity()
{
float length = pev->velocity.Length();

// ceiling at 1500. The gib velocity equation is not bounded properly. Rather than tune it
#ifdef REGAMEDLL_FIXES
float topspeed = Q_min(1500.0f, CVAR_GET_FLOAT("sv_maxvelocity"));
#else
float topspeed = 1500.0f;
#endif

// ceiling at topspeed. The gib velocity equation is not bounded properly. Rather than tune it
// in 3 separate places again, I'll just limit it here.
if (length > 1500.0)
if (length > topspeed)
{
// This should really be sv_maxvelocity * 0.75 or something
s1lentq marked this conversation as resolved.
Show resolved Hide resolved
pev->velocity = pev->velocity.Normalize() * 1500;
pev->velocity = pev->velocity.Normalize() * topspeed;
}
}

Expand Down