CBasePlayer::SmoothViewOnStairs
0x004189e0 · 376 bytes · __thiscall
_ZN11CBasePlayer18SmoothViewOnStairsER6Vector
Decompiled
undefined (2 params)
/* CBasePlayer::SmoothViewOnStairs(Vector&) */
void __thiscall CBasePlayer::SmoothViewOnStairs(CBasePlayer *this,Vector *param_1)
{
float fVar1;
int iVar2;
int iVar3;
float fVar4;
float fVar5;
float fVar6;
iVar2 = CBaseEntity::GetGroundEntity((CBaseEntity *)this);
fVar1 = *(float *)(this + 0x3a4);
iVar3 = (**(code **)(*(int *)this + 0x250))(this);
fVar4 = *(float *)(iVar3 + 8);
if ((((iVar2 != 0) && (*(char *)(iVar2 + 0x186) == '\0')) &&
(fVar5 = *(float *)(this + 0x207c), fVar5 != fVar1)) &&
((*(int *)(smoothstairs._28_4_ + 0x30) != 0 && (fVar4 == *(float *)(this + 0x2080))))) {
if (fVar5 < fVar1) {
fVar6 = 0.0;
fVar4 = *(float *)(gpGlobals + 0x10);
if (fVar4 <= 0.0) {
fVar4 = 0.0;
}
fVar5 = fVar4 * 150.0 + fVar5;
if (fVar5 <= fVar1) {
if (fVar1 - fVar5 <= 18.0) {
*(float *)(this + 0x207c) = fVar5;
fVar6 = fVar5 - fVar1;
}
else {
*(float *)(this + 0x207c) = fVar1 - 18.0;
fVar6 = (fVar1 - 18.0) - fVar1;
}
}
else {
*(float *)(this + 0x207c) = fVar1;
}
}
else {
fVar4 = *(float *)(gpGlobals + 0x10);
if (fVar4 <= 0.0) {
fVar4 = 0.0;
}
fVar5 = -fVar4 * 150.0 + fVar5;
if (fVar1 <= fVar5) {
if (fVar1 - fVar5 < -18.0) {
fVar5 = fVar1 + 18.0;
}
*(float *)(this + 0x207c) = fVar5;
fVar6 = fVar5 - fVar1;
}
else {
*(float *)(this + 0x207c) = fVar1;
fVar6 = 0.0;
}
}
*(float *)(param_1 + 8) = fVar6 + *(float *)(param_1 + 8);
return;
}
*(float *)(this + 0x207c) = fVar1;
*(float *)(this + 0x2080) = fVar4;
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.