Created
October 21, 2016 06:36
-
-
Save nosoop/059c38e40da1c1a686f0225a3501bbb4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Adds another punch angle to the player view. | |
* | |
* Equivalent to CBasePlayer::ViewPunch(const QAngle &angleOffset)??? | |
*/ | |
stock void AddPlayerViewPunch(int client, const float vecAngleOffset[3]) { | |
float vecAnglePlayer[3], vecAngleAdditive[3]; | |
GetEntPropVector(client, Prop_Data, "m_vecPunchAngleVel", vecAnglePlayer); | |
// (copy angleOffset for modification) | |
AddVectors(vecAngleOffset, NULL_VECTOR, vecAngleAdditive); | |
// angleOffset *= 20 (???) | |
ScaleVector(vecAngleAdditive, 20.0); | |
// m_vecPunchAngleVel += angleOffset | |
AddVectors(vecAnglePlayer, vecAngleAdditive, vecAnglePlayer); | |
SetEntPropVector(client, Prop_Data, "m_vecPunchAngleVel", vecAnglePlayer); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment