HunterLeapToCover::Update
0x00a9f7e0 · 933 bytes · __thiscall
_ZN17HunterLeapToCover6UpdateEP6Hunterf
Decompiled
undefined (3 params)
/* HunterLeapToCover::Update(Hunter*, float) */
HunterLeapToCover * __thiscall
HunterLeapToCover::Update(HunterLeapToCover *this,Hunter *param_1,float param_2)
{
uint uVar1;
code *pcVar2;
char cVar3;
int iVar4;
int *piVar5;
undefined *puVar6;
longdouble lVar7;
float fVar8;
float fVar9;
float fVar10;
double dVar11;
undefined4 local_28;
undefined4 local_24;
float local_20;
uVar1 = *(uint *)((int)param_2 + 0x30bc);
if ((((uVar1 == 0xffffffff) ||
(puVar6 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar6 == (undefined *)0xfffffffc)) ||
(*(uint *)(puVar6 + 8) != uVar1 >> 0xc)) || (*(int *)(puVar6 + 4) == 0)) {
*(undefined4 *)this = 3;
*(undefined4 *)(this + 4) = 0;
*(char **)(this + 8) = "No ability!";
return this;
}
iVar4 = CDirectorTacticalServices::GetClosestSurvivor
(*(CDirectorTacticalServices **)(TheDirector + 0x628),
(CBaseCombatCharacter *)param_2,true,true);
if (iVar4 != 0) {
cVar3 = (**(code **)(*(int *)((int)param_2 + 0x4028) + 0x11c))
((int)param_2 + 0x4028,iVar4,
*(undefined4 *)(HunterLeapAwayGiveUpRange._28_4_ + 0x2c));
if (cVar3 != '\0') {
*(undefined4 *)this = 3;
*(undefined4 *)(this + 4) = 0;
*(char **)(this + 8) = "Far away";
return this;
}
cVar3 = (**(code **)(*(int *)((int)param_2 + 0x4028) + 0x114))
((int)param_2 + 0x4028,iVar4,
*(undefined4 *)(HunterCommittedAttackRange._28_4_ + 0x2c));
if ((cVar3 != '\0') &&
((*(float *)(iVar4 + 0x2dbc) <= 0.0 ||
(lVar7 = (longdouble)CountdownTimer::Now(), *(float *)(iVar4 + 0x2dbc) <= (float)lVar7)))) {
*(undefined4 *)this = 3;
*(undefined4 *)(this + 4) = 0;
*(char **)(this + 8) = "Very close - attack!";
return this;
}
}
(**(code **)(*(int *)param_2 + 0x958))(param_2);
piVar5 = (int *)(**(code **)(*(int *)param_2 + 0x9b0))(param_2);
cVar3 = (**(code **)(*piVar5 + 0xf8))(piVar5);
if (cVar3 == '\0') {
param_1[0x44] = (Hunter)0x1;
}
else {
if (param_1[0x44] != (Hunter)0x0) {
*(undefined4 *)this = 3;
*(undefined4 *)(this + 4) = 0;
*(char **)(this + 8) = "Escaped!";
return this;
}
lVar7 = (longdouble)CountdownTimer::Now();
if (*(float *)(param_1 + 0x40) <= (float)lVar7) {
iVar4 = *(int *)(param_1 + 0x34);
if ((*(byte *)((int)param_2 + 0x14d) & 8) != 0) {
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)param_2);
}
fVar10 = *(float *)((int)param_2 + 0x2e0) - *(float *)(iVar4 + 0x2c);
fVar8 = *(float *)((int)param_2 + 0x2e8) - *(float *)(iVar4 + 0x34);
fVar9 = *(float *)((int)param_2 + 0x2e4) - *(float *)(iVar4 + 0x30);
fVar9 = SQRT(fVar8 * fVar8 + fVar10 * fVar10 + fVar9 * fVar9);
fVar8 = fVar9 * *(float *)(HunterPounceLoftRate._28_4_ + 0x2c);
if (*(float *)(HunterPounceMaxLoftAngle._28_4_ + 0x2c) <= fVar8) {
fVar8 = *(float *)(HunterPounceMaxLoftAngle._28_4_ + 0x2c);
}
piVar5 = (int *)(**(code **)(*(int *)param_2 + 0x9b4))(param_2);
pcVar2 = *(code **)(*piVar5 + 0xc0);
dVar11 = tan((double)(fVar8 * 0.017453292));
iVar4 = *(int *)(param_1 + 0x34);
local_28 = *(undefined4 *)(iVar4 + 0x2c);
local_20 = (float)((double)fVar9 * dVar11) + *(float *)(iVar4 + 0x34);
local_24 = *(undefined4 *)(iVar4 + 0x30);
(*pcVar2)(piVar5,&local_28,3,0x3f800000,&Update(Hunter*,float)::pressFireButton,
"Leap away loft angle",1,0x3e800000);
lVar7 = (longdouble)CountdownTimer::Now();
if ((float)lVar7 + 0.2 != *(float *)(param_1 + 0x40)) {
(**(code **)(*(int *)(param_1 + 0x38) + 4))(param_1 + 0x38,param_1 + 0x40);
*(float *)(param_1 + 0x40) = (float)lVar7 + 0.2;
}
if (*(float *)(param_1 + 0x3c) != 0.2) {
(**(code **)(*(int *)(param_1 + 0x38) + 4))(param_1 + 0x38,param_1 + 0x3c);
*(undefined4 *)(param_1 + 0x3c) = 0x3e4ccccd;
}
}
}
*(undefined4 *)this = 0;
*(undefined4 *)(this + 4) = 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.