COPYPASTE
.wiki
API
Tools
FAQ
Archive
paste
Search pastes
Login
Sign up
New Paste
Paste text
void CGameMovement::AddGravity( void ) { float ent_gravity; if ( player->m_flWaterJumpTime ) return; if (player->GetGravity()) ent_gravity = player->GetGravity(); else ent_gravity = 1.0; // Add gravity incorrectly mv->m_vecVelocity[2] -= (ent_gravity * GetCurrentGravity() * gpGlobals->frametime); mv->m_vecVelocity[2] += player->GetBaseVelocity()[2] * gpGlobals->frametime; Vector temp = player->GetBaseVelocity(); temp[2] = 0; player->SetBaseVelocity( temp ); CheckVelocity(); } void CGameMovement::StartGravity( void ) { float ent_gravity; if (player->GetGravity()) ent_gravity = player->GetGravity(); else ent_gravity = 1.0; // Add gravity so they'll be in the correct position during movement // yes, this 0.5 looks wrong, but it's not. mv->m_vecVelocity[2] -= (ent_gravity * GetCurrentGravity() * 0.5 * gpGlobals->frametime ); mv->m_vecVelocity[2] += player->GetBaseVelocity()[2] * gpGlobals->frametime; Vector temp = player->GetBaseVelocity(); temp[ 2 ] = 0; player->SetBaseVelocity( temp ); CheckVelocity(); } void CGameMovement::FinishGravity( void ) { float ent_gravity; if ( player->m_flWaterJumpTime ) return; if ( player->GetGravity() ) ent_gravity = player->GetGravity(); else ent_gravity = 1.0; // Get the correct velocity for the end of the dt mv->m_vecVelocity[2] -= (ent_gravity * GetCurrentGravity() * gpGlobals->frametime * 0.5); CheckVelocity(); }
Up to 512 KB. Tab inserts a tab, Ctrl+Enter submits.
Optional Paste Settings
Category:
None
Scripts
Deobfuscation
Logs
Configs
Notes
Data
Other
Tags:
Syntax Highlighting:
None
Luau
Lua
JSON
JavaScript
TypeScript
Python
C++
C
C#
Java
Rust
Go
Bash
SQL
HTML / XML
CSS
YAML
INI / TOML
Markdown
Diff
Paste Expiration:
Never
10 Minutes
1 Hour
1 Day
1 Week
2 Weeks
1 Month
6 Months
1 Year
Paste Exposure:
Public
Unlisted
Password:
NEW
Disabled
Paste password
Burn after read
NEW
Paste Name / Title:
Create New Paste
You are not logged in, so you can't edit or delete anything you paste.
Sign up
or
Login