InfectedSitDown::OnStart
0x00a366e0 · 761 bytes · __thiscall
_ZN15InfectedSitDown7OnStartEP8InfectedP6ActionIS0_E
Decompiled
undefined (3 params)
/* InfectedSitDown::OnStart(Infected*, Action<Infected>*) */
InfectedSitDown * __thiscall
InfectedSitDown::OnStart(InfectedSitDown *this,Infected *param_1,Action *param_2)
{
float fVar1;
code *pcVar2;
char cVar3;
int *piVar4;
undefined4 uVar5;
uint uVar6;
undefined4 *puVar7;
longdouble lVar8;
piVar4 = (int *)(**(code **)(*(int *)param_2 + 0x594))(param_2);
pcVar2 = *(code **)*enginetrace;
uVar5 = (**(code **)(*(int *)(param_2 + 0x1a3c) + 0xd4))(param_2 + 0x1a3c);
uVar6 = (*pcVar2)(enginetrace,uVar5,0x4030,0);
if ((uVar6 & 0x4030) != 0) {
puVar7 = ::operator_new(0x34);
*(undefined4 *)this = 1;
puVar7[8] = 0;
puVar7[9] = 0;
puVar7[10] = 0;
puVar7[3] = 0;
puVar7[4] = 0;
puVar7[5] = 0;
puVar7[6] = 0;
puVar7[7] = 0;
puVar7[2] = 0;
*(undefined1 *)(puVar7 + 0xc) = 0;
*(undefined1 *)((int)puVar7 + 0x31) = 0;
puVar7[0xb] = 0;
*puVar7 = &PTR__InfectedStandDazed_00d25148;
puVar7[1] = &PTR__InfectedStandDazed_00d252ac;
*(undefined4 **)(this + 4) = puVar7;
*(char **)(this + 8) = "I don\'t want to sit in the water here - standing instead";
return this;
}
cVar3 = Infected::IsGroundLevel((Infected *)param_2,30.0);
if (cVar3 == '\0') {
puVar7 = ::operator_new(0x34);
*(undefined4 *)this = 1;
puVar7[8] = 0;
puVar7[9] = 0;
puVar7[10] = 0;
puVar7[3] = 0;
puVar7[4] = 0;
puVar7[5] = 0;
puVar7[6] = 0;
puVar7[7] = 0;
puVar7[2] = 0;
*(undefined1 *)(puVar7 + 0xc) = 0;
*(undefined1 *)((int)puVar7 + 0x31) = 0;
puVar7[0xb] = 0;
*puVar7 = &PTR__InfectedStandDazed_00d25148;
puVar7[1] = &PTR__InfectedStandDazed_00d252ac;
*(undefined4 **)(this + 4) = puVar7;
*(char **)(this + 8) = "No room to sit down - standing instead";
}
else {
lVar8 = (longdouble)RandomFloat(0x41200000,0x41f00000);
fVar1 = (float)lVar8;
lVar8 = (longdouble)CountdownTimer::Now();
if ((float)lVar8 + fVar1 != *(float *)(param_1 + 0x3c)) {
(**(code **)(*(int *)(param_1 + 0x34) + 4))(param_1 + 0x34,param_1 + 0x3c);
*(float *)(param_1 + 0x3c) = (float)lVar8 + fVar1;
}
if (fVar1 != *(float *)(param_1 + 0x38)) {
(**(code **)(*(int *)(param_1 + 0x34) + 4))(param_1 + 0x34,param_1 + 0x38);
*(float *)(param_1 + 0x38) = fVar1;
}
cVar3 = (**(code **)(*piVar4 + 0x100))(piVar4,2);
if (cVar3 != '\0') {
*(undefined4 *)this = 0;
*(undefined4 *)(this + 4) = 0;
*(undefined4 *)(this + 8) = 0;
return this;
}
puVar7 = ::operator_new(0x38);
*(undefined4 *)this = 2;
puVar7[8] = 0;
puVar7[9] = 0;
puVar7[10] = 0;
puVar7[3] = 0;
puVar7[4] = 0;
puVar7[5] = 0;
puVar7[6] = 0;
puVar7[7] = 0;
puVar7[2] = 0;
*(undefined1 *)(puVar7 + 0xc) = 0;
*(undefined1 *)((int)puVar7 + 0x31) = 0;
puVar7[0xb] = 0;
*puVar7 = &PTR__InfectedChangePosture_00d219e8;
puVar7[1] = &PTR__InfectedChangePosture_00d21b4c;
puVar7[0xd] = 2;
*(undefined4 **)(this + 4) = puVar7;
*(undefined4 *)(param_1 + 0x20) = 0;
*(undefined4 *)(param_1 + 0x24) = 0;
*(undefined4 *)(param_1 + 0x28) = 0;
*(undefined4 *)(param_1 + 0x2c) = 0;
*(undefined4 *)(this + 8) = 0;
}
return this;
}
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.