ChargerChargeAtVictim::OnStart
0x00a8c3a0 · 545 bytes · __cdecl
_ZN21ChargerChargeAtVictim7OnStartEP7ChargerP6ActionIS0_E
Decompiled
undefined (2 params)
/* ChargerChargeAtVictim::OnStart(Charger*, Action<Charger>*) */
Charger * ChargerChargeAtVictim::OnStart(Charger *param_1,Action *param_2)
{
float fVar1;
uint uVar2;
int iVar3;
undefined *puVar4;
longdouble lVar5;
uVar2 = *(uint *)(param_2 + 0x34);
if ((((uVar2 != 0xffffffff) &&
(puVar4 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar4 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar4 + 8) == uVar2 >> 0xc)) && (*(int *)(puVar4 + 4) != 0)) {
iVar3 = GetDifficulty();
if (iVar3 == 1) {
lVar5 = (longdouble)RandomFloat(0x3dcccccd,0x3ea8f5c3);
fVar1 = (float)lVar5;
lVar5 = (longdouble)CountdownTimer::Now();
if ((float)lVar5 + fVar1 != *(float *)(param_2 + 0x50)) {
(**(code **)(*(int *)(param_2 + 0x48) + 4))(param_2 + 0x48,param_2 + 0x50);
*(float *)(param_2 + 0x50) = (float)lVar5 + fVar1;
}
if (fVar1 != *(float *)(param_2 + 0x4c)) {
(**(code **)(*(int *)(param_2 + 0x48) + 4))(param_2 + 0x48,param_2 + 0x4c);
*(float *)(param_2 + 0x4c) = fVar1;
}
}
else if (iVar3 < 2) {
if (iVar3 == 0) {
lVar5 = (longdouble)RandomFloat(0x3e4ccccd,0x3f28f5c3);
fVar1 = (float)lVar5;
lVar5 = (longdouble)CountdownTimer::Now();
if ((float)lVar5 + fVar1 != *(float *)(param_2 + 0x50)) {
(**(code **)(*(int *)(param_2 + 0x48) + 4))(param_2 + 0x48,param_2 + 0x50);
*(float *)(param_2 + 0x50) = (float)lVar5 + fVar1;
}
if (fVar1 != *(float *)(param_2 + 0x4c)) {
(**(code **)(*(int *)(param_2 + 0x48) + 4))(param_2 + 0x48,param_2 + 0x4c);
*(float *)(param_2 + 0x4c) = fVar1;
}
}
}
else if (iVar3 < 4) {
lVar5 = (longdouble)CountdownTimer::Now();
if ((float)lVar5 + 0.1 != *(float *)(param_2 + 0x50)) {
(**(code **)(*(int *)(param_2 + 0x48) + 4))(param_2 + 0x48,param_2 + 0x50);
*(float *)(param_2 + 0x50) = (float)lVar5 + 0.1;
}
if (*(float *)(param_2 + 0x4c) != 0.1) {
(**(code **)(*(int *)(param_2 + 0x48) + 4))(param_2 + 0x48,param_2 + 0x4c);
*(undefined4 *)(param_2 + 0x4c) = 0x3dcccccd;
}
}
param_2[0x44] = (Action)0x0;
*(undefined4 *)param_1 = 0;
*(undefined4 *)(param_1 + 4) = 0;
*(undefined4 *)(param_1 + 8) = 0;
return param_1;
}
*(undefined4 *)param_1 = 3;
*(undefined4 *)(param_1 + 4) = 0;
*(char **)(param_1 + 8) = "No victim";
return param_1;
}
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.