CBaseToggle::AngularMove
0x00834530 · 372 bytes · __thiscall
_ZN11CBaseToggle11AngularMoveERK6QAnglef
Decompiled
undefined (3 params)
/* CBaseToggle::AngularMove(QAngle const&, float) */
void __thiscall CBaseToggle::AngularMove(CBaseToggle *this,QAngle *param_1,float param_2)
{
undefined4 uVar1;
float fVar2;
float fVar3;
float fVar4;
float fVar5;
float local_18;
float local_14;
float local_10;
*(undefined4 *)(this + 0x4a4) = *(undefined4 *)param_1;
*(undefined4 *)(this + 0x4a8) = *(undefined4 *)(param_1 + 4);
uVar1 = *(undefined4 *)(param_1 + 8);
*(undefined4 *)(this + 0x4b0) = 2;
*(undefined4 *)(this + 0x4ac) = uVar1;
if (*(float *)(this + 0x3a8) == *(float *)param_1) {
fVar4 = *(float *)(this + 0x3ac);
fVar5 = *(float *)(param_1 + 4);
fVar2 = fVar4;
if (fVar4 == *(float *)(param_1 + 4)) {
fVar5 = *(float *)(this + 0x3b0);
fVar3 = *(float *)(param_1 + 8);
if ((fVar5 == *(float *)(param_1 + 8)) && (fVar3 = fVar5, this[0x450] == (CBaseToggle)0x0)) {
(**(code **)(*(int *)this + 0xe0))(this);
return;
}
goto LAB_008345a5;
}
}
else {
fVar2 = *(float *)(this + 0x3ac);
fVar5 = *(float *)(param_1 + 4);
}
fVar4 = fVar5;
fVar5 = *(float *)(this + 0x3b0);
fVar3 = *(float *)(param_1 + 8);
LAB_008345a5:
fVar4 = fVar4 - fVar2;
fVar3 = fVar3 - fVar5;
fVar5 = *(float *)param_1 - *(float *)(this + 0x3a8);
fVar2 = SQRT(fVar3 * fVar3 + fVar4 * fVar4 + fVar5 * fVar5) / param_2;
if (fVar2 <= 0.01) {
fVar2 = 0.01;
}
CBaseEntity::SetMoveDoneTime((CBaseEntity *)this,fVar2);
fVar2 = 1.0 / fVar2;
local_18 = fVar5 * fVar2;
local_14 = fVar4 * fVar2;
local_10 = fVar2 * fVar3;
CBaseEntity::SetLocalAngularVelocity((CBaseEntity *)this,(QAngle *)&local_18);
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.