ChargerChargeAtVictim::Update
0x00a8c130 · 583 bytes · __thiscall
_ZN21ChargerChargeAtVictim6UpdateEP7Chargerf
Decompiled
undefined (3 params)
/* ChargerChargeAtVictim::Update(Charger*, float) */
ChargerChargeAtVictim * __thiscall
ChargerChargeAtVictim::Update(ChargerChargeAtVictim *this,Charger *param_1,float param_2)
{
uint uVar1;
int *piVar2;
char cVar3;
int *piVar4;
undefined *puVar5;
undefined *puVar6;
longdouble lVar7;
undefined4 local_20;
uVar1 = *(uint *)(param_1 + 0x34);
if ((((uVar1 == 0xffffffff) ||
(puVar5 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar5 == (undefined *)0xfffffffc)) ||
(*(uint *)(puVar5 + 8) != uVar1 >> 0xc)) ||
(*(CBaseEntity **)(puVar5 + 4) == (CBaseEntity *)0x0)) {
*(undefined4 *)this = 3;
*(undefined4 *)(this + 4) = 0;
*(char **)(this + 8) = "Lost our victim";
}
else {
uVar1 = *(uint *)((int)param_2 + 0x30bc);
if (((uVar1 != 0xffffffff) &&
(puVar6 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar6 != (undefined *)0xfffffffc)) &&
((*(uint *)(puVar6 + 8) == uVar1 >> 0xc &&
(piVar2 = *(int **)(puVar6 + 4), piVar2 != (int *)0x0)))) {
if ((param_1[0x44] != (Charger)0x0) && ((*(byte *)((int)param_2 + 0x150) & 0x20) == 0)) {
*(undefined4 *)this = 3;
*(undefined4 *)(this + 4) = 0;
*(char **)(this + 8) = "Finished Charge";
return this;
}
cVar3 = UTIL_IsFacingWithinTolerance
((CBaseEntity *)param_2,*(CBaseEntity **)(puVar5 + 4),0.6,(float *)0x0);
if (cVar3 != '\0') {
piVar4 = (int *)(**(code **)(*(int *)param_2 + 0x9b4))(param_2);
local_20 = 0;
uVar1 = *(uint *)(param_1 + 0x34);
if (((uVar1 != 0xffffffff) &&
(puVar5 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar5 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar5 + 8) == uVar1 >> 0xc)) {
local_20 = *(undefined4 *)(puVar5 + 4);
}
(**(code **)(*piVar4 + 0xc4))(piVar4,local_20,0,0,0,0,1,0x3e800000);
}
lVar7 = (longdouble)CountdownTimer::Now();
if (*(float *)(param_1 + 0x50) <= (float)lVar7) {
cVar3 = CTerrorPlayer::IsCustomAbilityActive((CTerrorPlayer *)param_2);
if ((cVar3 == '\0') && (param_1[0x44] == (Charger)0x0)) {
cVar3 = (**(code **)(*piVar2 + 0x32c))(piVar2);
if (cVar3 != '\0') {
(**(code **)(*(int *)param_2 + 0x938))(param_2,0xbf800000);
param_1[0x44] = (Charger)0x1;
if (*(float *)(param_1 + 0x50) != -1.0) {
(**(code **)(*(int *)(param_1 + 0x48) + 4))(param_1 + 0x48,param_1 + 0x50);
*(undefined4 *)(param_1 + 0x50) = 0xbf800000;
}
}
}
}
*(undefined4 *)this = 0;
*(undefined4 *)(this + 4) = 0;
*(undefined4 *)(this + 8) = 0;
return this;
}
*(undefined4 *)this = 3;
*(undefined4 *)(this + 4) = 0;
*(char **)(this + 8) = "No ability exists!";
}
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.