CTriggerCamera::Move
0x00b1a670 · 890 bytes · __thiscall
_ZN14CTriggerCamera4MoveEv
Decompiled
undefined (1 param)
/* CTriggerCamera::Move() */
void __thiscall CTriggerCamera::Move(CTriggerCamera *this)
{
float fVar1;
uint uVar2;
int *piVar3;
char cVar4;
int iVar5;
undefined *puVar6;
longdouble lVar7;
float fVar8;
float fVar9;
float local_20;
float local_1c;
float local_18;
undefined4 local_14;
undefined4 local_10;
if (((((((byte)this[0x148] & 0x40) != 0) && (uVar2 = *(uint *)(this + 0x440), uVar2 != 0xffffffff)
) && (puVar6 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar6 != (undefined *)0xfffffffc))
&& ((*(uint *)(puVar6 + 8) == uVar2 >> 0xc &&
(piVar3 = *(int **)(puVar6 + 4), piVar3 != (int *)0x0)))) &&
(cVar4 = (**(code **)(*piVar3 + 0x16c))(piVar3), cVar4 != '\0')) {
iVar5 = piVar3[0x72c];
if ((*(int *)(this + 0x494) != iVar5) && (iVar5 != 0)) {
Disable(this);
return;
}
*(int *)(this + 0x494) = iVar5;
}
iVar5 = gpGlobals;
piVar3 = *(int **)(this + 0x448);
if (piVar3 != (int *)0x0) {
fVar9 = *(float *)(this + 0x11c);
fVar8 = *(float *)(this + 0x45c) - *(float *)(gpGlobals + 0x10) * fVar9;
*(float *)(this + 0x45c) = fVar8;
if (fVar8 <= 0.0) {
local_20 = 0.0;
local_14 = 0xffffffff;
local_10 = 0;
(**(code **)(*piVar3 + 0xb4))(piVar3,"InPass",this,this,&local_20,0);
iVar5 = CBaseEntity::GetNextTarget(*(CBaseEntity **)(this + 0x448));
*(int *)(this + 0x448) = iVar5;
if (iVar5 == 0) {
CBaseEntity::SetAbsVelocity((CBaseEntity *)this,(Vector *)&vec3_origin);
fVar8 = *(float *)(this + 0x458);
fVar9 = *(float *)(this + 0x11c);
iVar5 = gpGlobals;
}
else {
if (*(float *)(iVar5 + 0x11c) != 0.0) {
*(float *)(this + 0x460) = *(float *)(iVar5 + 0x11c);
}
fVar9 = *(float *)(iVar5 + 0x3a4);
fVar8 = *(float *)(iVar5 + 0x39c);
*(float *)(this + 0x478) = *(float *)(iVar5 + 0x3a0) - *(float *)(this + 0x3a0);
*(float *)(this + 0x47c) = fVar9 - *(float *)(this + 0x3a4);
*(float *)(this + 0x474) = fVar8 - *(float *)(this + 0x39c);
lVar7 = (longdouble)VectorNormalize((Vector *)(this + 0x474));
iVar5 = gpGlobals;
*(float *)(this + 0x45c) = (float)lVar7;
fVar8 = *(float *)(iVar5 + 0xc);
lVar7 = (longdouble)(**(code **)(**(int **)(this + 0x448) + 0x150))(*(int **)(this + 0x448))
;
iVar5 = gpGlobals;
fVar9 = *(float *)(this + 0x11c);
fVar8 = (float)lVar7 + fVar8;
*(float *)(this + 0x458) = fVar8;
}
}
else {
fVar8 = *(float *)(this + 0x458);
}
if (*(float *)(iVar5 + 0xc) <= fVar8 && fVar8 != *(float *)(iVar5 + 0xc)) {
lVar7 = (longdouble)Approach(0.0,fVar9,*(float *)(iVar5 + 0x10) * *(float *)(this + 0x46c));
*(float *)(this + 0x11c) = (float)lVar7;
}
else {
lVar7 = (longdouble)
Approach(*(float *)(this + 0x460),fVar9,
*(float *)(iVar5 + 0x10) * *(float *)(this + 0x468));
*(float *)(this + 0x11c) = (float)lVar7;
}
fVar9 = *(float *)(gpGlobals + 0x10) + *(float *)(gpGlobals + 0x10);
fVar8 = 1.0 - fVar9;
if (((byte)this[0x14d] & 0x10) != 0) {
CBaseEntity::CalcAbsoluteVelocity((CBaseEntity *)this);
}
fVar1 = *(float *)(this + 0x11c);
local_1c = *(float *)(this + 0x278) * fVar8 + *(float *)(this + 0x478) * fVar1 * fVar9;
local_18 = *(float *)(this + 0x27c) * fVar8 + *(float *)(this + 0x47c) * fVar1 * fVar9;
local_20 = fVar8 * *(float *)(this + 0x274) + fVar1 * *(float *)(this + 0x474) * fVar9;
CBaseEntity::SetAbsVelocity((CBaseEntity *)this,(Vector *)&local_20);
}
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.