CTerrorGameMovement::DecayPunchAngle
0x004f8940 · 607 bytes · __thiscall
_ZN19CTerrorGameMovement15DecayPunchAngleEv
Decompiled
undefined (1 param)
/* CTerrorGameMovement::DecayPunchAngle() */
void __thiscall CTerrorGameMovement::DecayPunchAngle(CTerrorGameMovement *this)
{
float fVar1;
int *piVar2;
CBaseEntity *this_00;
float fVar3;
char cVar4;
int iVar5;
longdouble lVar6;
float fVar7;
float local_18;
float local_14;
float local_10;
piVar2 = *(int **)(this + 0x810);
if (piVar2 == (int *)0x0) {
return;
}
cVar4 = (**(code **)(*piVar2 + 0x7e8))(piVar2);
if (((cVar4 == '\0') || (*(char *)((int)piVar2 + 0x39f1) != '\0')) ||
((char)piVar2[0xcf7] != '\0')) {
this_00 = *(CBaseEntity **)(this + 0x810);
iVar5 = CBaseEntity::GetTeamNumber(this_00);
if (((iVar5 != 3) || (iVar5 = (**(code **)(*(int *)this_00 + 0x544))(this_00), iVar5 != 8)) ||
(iVar5 = CTerrorPlayer::GetStaggerDir(*(CTerrorPlayer **)(this + 0x810)), iVar5 == 0))
goto LAB_004f897b;
fVar7 = *(float *)(ZombieHulkGrenadeRoll._28_4_ + 0x2c);
}
else {
fVar7 = *(float *)(SurvivorIncapRoll._28_4_ + 0x2c);
}
if (fVar7 == 0.0) {
LAB_004f897b:
CCSGameMovement::DecayPunchAngle((CCSGameMovement *)this);
return;
}
iVar5 = *(int *)(this + 0x810);
local_10 = 0.0;
local_18 = *(float *)(iVar5 + 0x1ab0);
fVar1 = *(float *)(iVar5 + 0x1ab8);
local_14 = *(float *)(iVar5 + 0x1ab4);
lVar6 = (longdouble)VectorNormalize((Vector *)&local_18);
iVar5 = *(int *)(this + 0x810);
fVar3 = (float)lVar6 -
((float)lVar6 * 0.5 + *(float *)(PunchAngleDecayRate._28_4_ + 0x2c)) *
*(float *)(gpGlobals + 0x10);
local_10 = *(float *)(gpGlobals + 0x10) * 10.0 * (fVar7 - fVar1) + fVar1;
if (fVar3 <= 0.0) {
fVar3 = 0.0;
}
fVar7 = local_18 * fVar3;
local_14 = fVar3 * local_14;
local_18 = fVar7;
if (fVar7 == *(float *)(iVar5 + 0x1ab0)) {
if (local_14 == *(float *)(iVar5 + 0x1ab4)) goto LAB_004f8aa6;
}
else {
(**(code **)(*(int *)(iVar5 + 0x1a40) + 4))(iVar5 + 0x1a40,iVar5 + 0x1ab0);
*(float *)(iVar5 + 0x1ab0) = fVar7;
iVar5 = *(int *)(this + 0x810);
if (local_14 == *(float *)(iVar5 + 0x1ab4)) goto LAB_004f8aa6;
}
fVar7 = local_14;
(**(code **)(*(int *)(iVar5 + 0x1a40) + 4))(iVar5 + 0x1a40,iVar5 + 0x1ab0);
*(float *)(iVar5 + 0x1ab4) = fVar7;
iVar5 = *(int *)(this + 0x810);
LAB_004f8aa6:
fVar7 = local_10;
if (local_10 == *(float *)(iVar5 + 0x1ab8)) {
return;
}
(**(code **)(*(int *)(iVar5 + 0x1a40) + 4))(iVar5 + 0x1a40,iVar5 + 0x1ab0);
*(float *)(iVar5 + 0x1ab8) = fVar7;
return;
}
SourceMod gamedata
paste intoaddons/sourcemod/gamedata/<your_plugin>.txt
used as the SourceMod key — change to fit your plugin's convention
SourceMod library name (server / engine / matchmaking)
Just a Signatures{} block, ready to drop into a gamedata
file. Wire it up in your plugin however you like - SDKCall, DHooks,
raw memory ops, or anything else.
Signatures + Functions block. The plugin uses
DHookCreateFromConf - DHooks reads return type, this-type,
calling convention, and argument types straight from the gamedata. Less
boilerplate in the plugin, types travel with the gamedata.
Gamedata KeyValues
DHooks plugin example
Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.