CMomentaryRotButton::InputSetPosition
0x00637f20 · 735 bytes · __thiscall
_ZN19CMomentaryRotButton16InputSetPositionER11inputdata_t
Decompiled
undefined (2 params)
/* CMomentaryRotButton::InputSetPosition(inputdata_t&) */
void __thiscall
CMomentaryRotButton::InputSetPosition(CMomentaryRotButton *this,inputdata_t *param_1)
{
longdouble lVar1;
float fVar2;
float fVar3;
float fVar4;
undefined1 local_44 [16];
float local_34;
float local_30;
float local_2c;
float local_28;
float local_24;
float local_20;
fVar2 = *(float *)(param_1 + 8);
if (*(int *)(param_1 + 0x18) == 1) {
if (fVar2 <= 0.0) {
fVar2 = 0.0;
}
if (1.0 <= fVar2) {
fVar2 = 1.0;
}
}
else {
fVar2 = 0.0;
}
*(float *)(this + 0x624) = fVar2;
lVar1 = (longdouble)GetPos(this,(QAngle *)(this + 0x3a8));
if ((float)lVar1 < *(float *)(this + 0x624)) {
local_20 = *(float *)(this + 0x11c);
local_28 = *(float *)(this + 0x46c) * local_20;
local_24 = *(float *)(this + 0x470) * local_20;
local_20 = local_20 * *(float *)(this + 0x474);
CBaseEntity::SetLocalAngularVelocity((CBaseEntity *)this,(QAngle *)&local_28);
*(undefined4 *)(this + 0x630) = 1;
}
else {
if ((float)lVar1 <= *(float *)(this + 0x624)) {
CBaseEntity::SetLocalAngularVelocity((CBaseEntity *)this,(QAngle *)&vec3_angle);
return;
}
local_20 = -*(float *)(this + 0x11c);
local_28 = *(float *)(this + 0x46c) * local_20;
local_24 = *(float *)(this + 0x470) * local_20;
local_20 = local_20 * *(float *)(this + 0x474);
CBaseEntity::SetLocalAngularVelocity((CBaseEntity *)this,(QAngle *)&local_28);
*(undefined4 *)(this + 0x630) = 0xffffffff;
}
*(code **)(this + 0x14) = SetPositionMoveDone;
*(undefined4 *)(this + 0x18) = 0;
CBaseEntity::ThinkSet((_func_void *)local_44,(float)this,(char *)UpdateThink);
CBaseEntity::SetNextThink((CBaseEntity *)this,*(float *)(gpGlobals + 0xc),(char *)0x0);
fVar2 = *(float *)(this + 0x444) * *(float *)(this + 0x624);
local_30 = *(float *)(this + 0x470) * fVar2 + *(float *)(this + 0x610);
local_2c = *(float *)(this + 0x474) * fVar2 + *(float *)(this + 0x614);
local_34 = fVar2 * *(float *)(this + 0x46c) + *(float *)(this + 0x60c);
lVar1 = (longdouble)
CBaseToggle::AxisDelta
(*(int *)(this + 0x148),(QAngle *)&local_34,(QAngle *)(this + 0x3a8));
fVar2 = *(float *)(gpGlobals + 0x1c);
fVar3 = ABS((float)lVar1) / *(float *)(this + 0x11c);
fVar4 = fVar2;
if (fVar3 < fVar2) {
local_28 = ABS((float)lVar1) / fVar2;
fVar4 = (float)*(int *)(this + 0x630);
local_24 = *(float *)(this + 0x470) * fVar4 * local_28;
local_20 = *(float *)(this + 0x474) * fVar4 * local_28;
local_28 = *(float *)(this + 0x46c) * fVar4 * local_28;
CBaseEntity::SetLocalAngularVelocity((CBaseEntity *)this,(QAngle *)&local_28);
fVar4 = *(float *)(gpGlobals + 0x1c);
fVar3 = fVar2;
}
fVar2 = fVar4 * 6.0;
if ((fVar3 <= fVar4 * 6.0) && (fVar2 = fVar4, fVar4 <= fVar3)) {
fVar2 = fVar3;
}
CBaseEntity::SetMoveDoneTime((CBaseEntity *)this,fVar2);
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.