CMomentaryRotButton::SetPositionMoveDone
0x006388d0 · 631 bytes · __thiscall
_ZN19CMomentaryRotButton19SetPositionMoveDoneEv
Decompiled
undefined (1 param)
/* CMomentaryRotButton::SetPositionMoveDone() */
void __thiscall CMomentaryRotButton::SetPositionMoveDone(CMomentaryRotButton *this)
{
longdouble lVar1;
float fVar2;
float fVar3;
float fVar4;
float local_24;
float local_20;
float local_1c;
float local_18;
float local_14;
float local_10;
lVar1 = (longdouble)GetPos(this,(QAngle *)(this + 0x3a8));
fVar2 = *(float *)(this + 0x624);
if (fVar2 <= (float)lVar1) {
if (*(int *)(this + 0x630) == 1) goto LAB_006389f1;
if (fVar2 < (float)lVar1) goto LAB_0063891e;
}
if (*(int *)(this + 0x630) != -1) {
LAB_0063891e:
fVar2 = fVar2 * *(float *)(this + 0x444);
local_20 = *(float *)(this + 0x470) * fVar2 + *(float *)(this + 0x610);
local_1c = *(float *)(this + 0x474) * fVar2 + *(float *)(this + 0x614);
local_24 = fVar2 * *(float *)(this + 0x46c) + *(float *)(this + 0x60c);
lVar1 = (longdouble)
CBaseToggle::AxisDelta
(*(int *)(this + 0x148),(QAngle *)&local_24,(QAngle *)(this + 0x3a8));
fVar2 = *(float *)(gpGlobals + 0x1c);
fVar3 = ABS((float)lVar1) / *(float *)(this + 0x11c);
fVar4 = fVar2;
if (fVar3 < fVar2) {
fVar4 = (float)*(int *)(this + 0x630);
local_18 = ABS((float)lVar1) / fVar2;
local_14 = *(float *)(this + 0x470) * fVar4 * local_18;
local_10 = *(float *)(this + 0x474) * fVar4 * local_18;
local_18 = *(float *)(this + 0x46c) * fVar4 * local_18;
CBaseEntity::SetLocalAngularVelocity((CBaseEntity *)this,(QAngle *)&local_18);
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;
}
LAB_006389f1:
CBaseEntity::SetLocalAngularVelocity((CBaseEntity *)this,(QAngle *)&vec3_angle);
fVar2 = *(float *)(this + 0x444) * *(float *)(this + 0x624);
local_14 = *(float *)(this + 0x470) * fVar2 + *(float *)(this + 0x610);
local_10 = *(float *)(this + 0x474) * fVar2 + *(float *)(this + 0x614);
local_18 = fVar2 * *(float *)(this + 0x46c) + *(float *)(this + 0x60c);
CBaseEntity::SetLocalAngles((CBaseEntity *)this,(QAngle *)&local_18);
CBaseEntity::SetNextThink((CBaseEntity *)this,-1.0,(char *)0x0);
CBaseEntity::SetMoveDoneTime((CBaseEntity *)this,-1.0);
if (this[0x62c] == (CMomentaryRotButton)0x0) {
OutputMovementComplete(this);
}
else {
UpdateTarget((float)this,(CBaseEntity *)this);
OutputMovementComplete(this);
}
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.