CTriggerWind::WindThink
0x00b14610 · 700 bytes · __thiscall
_ZN12CTriggerWind9WindThinkEv
Decompiled
undefined (1 param)
/* CTriggerWind::WindThink() */
void __thiscall CTriggerWind::WindThink(CTriggerWind *this)
{
int iVar1;
int *piVar2;
int iVar3;
int iVar4;
uint uVar5;
longdouble lVar6;
float fVar7;
float fVar8;
CTriggerWind *pCVar9;
code *pcVar10;
undefined4 uVar11;
char *pcVar12;
int local_28;
undefined1 local_24 [20];
pcVar12 = "WindThinkContext";
fVar7 = *(float *)(gpGlobals + 0xc) + 0.1;
pcVar10 = WindThink;
uVar11 = 0;
pCVar9 = this;
CBaseEntity::ThinkSet((_func_void *)local_24,(float)this,(char *)WindThink);
piVar2 = random_valve;
if (this[0x474] == (CTriggerWind)0x0) {
iVar1 = *(int *)(this + 0x458);
iVar3 = *(int *)(this + 0x454);
uVar5 = iVar1 - iVar3 >> 0x1f;
if (5.0 < (float)(int)((iVar1 - iVar3 ^ uVar5) - uVar5)) {
fVar8 = 5.0;
if (iVar1 <= iVar3) {
fVar8 = -5.0;
}
iVar4 = *(int *)(this + 0x468);
*(int *)(this + 0x454) = (int)(fVar8 + (float)iVar3);
local_28 = *(int *)(this + 0x464);
uVar5 = iVar4 - local_28 >> 0x1f;
if ((float)(int)((iVar4 - local_28 ^ uVar5) - uVar5) <= 5.0) goto LAB_00b147c1;
}
else {
local_28 = *(int *)(this + 0x464);
iVar4 = *(int *)(this + 0x468);
uVar5 = iVar4 - local_28 >> 0x1f;
if ((float)(int)((iVar4 - local_28 ^ uVar5) - uVar5) <= 5.0) {
*(int *)(this + 0x454) = iVar1;
iVar1 = *(int *)(this + 0x46c);
lVar6 = (longdouble)
(**(code **)(*random_valve + 4))
(random_valve,(float)-*(int *)(this + 0x470),(float)*(int *)(this + 0x470)
);
pcVar12 = "WindThinkContext";
pcVar10 = WindThink;
uVar11 = 0;
fVar7 = (float)lVar6 + (float)iVar1;
pCVar9 = this;
CBaseEntity::ThinkSet((_func_void *)local_24,(float)this,(char *)WindThink);
iVar1 = *(int *)(this + 0x454);
this[0x474] = (CTriggerWind)0x1;
goto joined_r0x00b147c9;
}
}
pCVar9 = (CTriggerWind *)(float)local_28;
pcVar10 = (code *)0x40a00000;
lVar6 = (longdouble)ApproachAngle((float)iVar4,(float)pCVar9,5.0);
*(int *)(this + 0x464) = (int)lVar6;
}
else {
this[0x474] = (CTriggerWind)0x0;
iVar1 = *(int *)(this + 0x44c);
iVar3 = (**(code **)(*piVar2 + 8))
(piVar2,-*(int *)(this + 0x450),*(int *)(this + 0x450),uVar11,fVar7,pcVar12);
piVar2 = random_valve;
pcVar10 = *(code **)(this + 0x460);
*(int *)(this + 0x458) = iVar1 + iVar3;
iVar1 = *(int *)(this + 0x45c);
pCVar9 = (CTriggerWind *)-(int)pcVar10;
iVar3 = (**(code **)(*piVar2 + 8))(piVar2,pCVar9,pcVar10);
*(int *)(this + 0x468) =
(int)((float)((int)((float)(iVar1 + iVar3) * 182.04445) & 0xffff) * 0.005493164);
}
LAB_00b147c1:
iVar1 = *(int *)(this + 0x454);
joined_r0x00b147c9:
if (iVar1 != 0) {
(**(code **)(**(int **)(this + 0x478) + 0x20))
(*(int **)(this + 0x478),pCVar9,pcVar10,uVar11,fVar7,pcVar12);
}
*(undefined4 *)(this + 0x480) = *(undefined4 *)(this + 0x464);
if (this[0x440] != (CTriggerWind)0x0) {
*(undefined4 *)(this + 0x484) = 0;
return;
}
*(float *)(this + 0x484) = (float)*(int *)(this + 0x454);
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.