CBaseToggle::LinearMove
0x00834300 · 446 bytes · __thiscall
_ZN11CBaseToggle10LinearMoveERK6Vectorf
Decompiled
undefined (3 params)
/* CBaseToggle::LinearMove(Vector const&, float) */
void __thiscall CBaseToggle::LinearMove(CBaseToggle *this,Vector *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 + 0x498) = *(undefined4 *)param_1;
*(undefined4 *)(this + 0x49c) = *(undefined4 *)(param_1 + 4);
uVar1 = *(undefined4 *)(param_1 + 8);
*(undefined4 *)(this + 0x4b0) = 1;
*(undefined4 *)(this + 0x4a0) = uVar1;
if (*(float *)(this + 0x39c) == *(float *)param_1) {
fVar4 = *(float *)(this + 0x3a0);
fVar3 = *(float *)(param_1 + 4);
fVar2 = fVar4;
if (fVar4 == *(float *)(param_1 + 4)) {
fVar3 = *(float *)(this + 0x3a4);
fVar5 = *(float *)(param_1 + 8);
if ((fVar3 == *(float *)(param_1 + 8)) && (fVar5 = fVar3, this[0x450] == (CBaseToggle)0x0)) {
(**(code **)(*(int *)this + 0xe0))(this);
return;
}
goto LAB_00834375;
}
}
else {
fVar2 = *(float *)(this + 0x3a0);
fVar3 = *(float *)(param_1 + 4);
}
fVar4 = fVar3;
fVar3 = *(float *)(this + 0x3a4);
fVar5 = *(float *)(param_1 + 8);
LAB_00834375:
fVar4 = fVar4 - fVar2;
fVar5 = fVar5 - fVar3;
fVar3 = *(float *)param_1 - *(float *)(this + 0x39c);
fVar2 = SQRT(fVar5 * fVar5 + fVar4 * fVar4 + fVar3 * fVar3) / param_2;
if (fVar2 < 0.0) {
CBaseEntity::SetMoveDoneTime((CBaseEntity *)this,-fVar2);
}
else {
CBaseEntity::SetMoveDoneTime((CBaseEntity *)this,fVar2);
}
fVar2 = 1.0 / fVar2;
local_18 = fVar3 * fVar2;
local_14 = fVar4 * fVar2;
local_10 = fVar2 * fVar5;
CBaseEntity::SetLocalVelocity((CBaseEntity *)this,(Vector *)&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.