SmokerMoveToAttackPosition::Update
0x00ac7670 · 752 bytes · __thiscall
_ZN26SmokerMoveToAttackPosition6UpdateEP6Smokerf
Decompiled
undefined (3 params)
/* SmokerMoveToAttackPosition::Update(Smoker*, float) */
SmokerMoveToAttackPosition * __thiscall
SmokerMoveToAttackPosition::Update(SmokerMoveToAttackPosition *this,Smoker *param_1,float param_2)
{
uint uVar1;
char cVar2;
int *piVar3;
SmokerMoveToAttackPosition *this_00;
int iVar4;
int *piVar5;
SmokerTongueVictim *this_01;
undefined *puVar6;
int iVar7;
CTerrorPlayer *pCVar8;
longdouble lVar9;
uVar1 = *(uint *)((int)param_2 + 0x30bc);
if ((((uVar1 == 0xffffffff) ||
(puVar6 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar6 == (undefined *)0xfffffffc)) ||
(*(uint *)(puVar6 + 8) != uVar1 >> 0xc)) ||
(piVar5 = *(int **)(puVar6 + 4), piVar5 == (int *)0x0)) {
*(undefined4 *)this = 3;
*(undefined4 *)(this + 4) = 0;
*(char **)(this + 8) = "No ability!";
return this;
}
pCVar8 = (CTerrorPlayer *)0x0;
uVar1 = *(uint *)(param_1 + 0x34);
if (((uVar1 != 0xffffffff) &&
(puVar6 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar6 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar6 + 8) == uVar1 >> 0xc)) {
pCVar8 = *(CTerrorPlayer **)(puVar6 + 4);
}
pCVar8 = (CTerrorPlayer *)
BossZombiePlayerBot::ChooseVictim
((BossZombiePlayerBot *)param_2,pCVar8,0,(CBaseCombatCharacter *)0x0);
if (pCVar8 == (CTerrorPlayer *)0x0) {
LAB_00ac7829:
PathFollower::Update((PathFollower *)(param_1 + 0x38),(INextBot *)((int)param_2 + 0x4028));
if (*(int *)(param_1 + 0x443c) < 1) {
CBaseEntity::SetAbsVelocity((CBaseEntity *)param_2,(Vector *)&vec3_origin);
}
piVar5 = (int *)(**(code **)(*(int *)param_2 + 0x9b0))(param_2);
cVar2 = (**(code **)(*piVar5 + 0xd4))(piVar5);
if ((cVar2 == '\0') &&
(((0.0 < *(float *)(param_1 + 0x482c) &&
(lVar9 = (longdouble)CountdownTimer::Now(), *(float *)(param_1 + 0x482c) <= (float)lVar9))
|| ((*(int *)(param_1 + 0x443c) < 1 &&
(lVar9 = (longdouble)CountdownTimer::Now(), *(float *)(param_1 + 0x4820) <= (float)lVar9
)))))) {
ComputePath((SmokerMoveToAttackPosition *)param_1,(Smoker *)param_2);
}
*(undefined4 *)this = 0;
*(undefined4 *)(this + 4) = 0;
*(undefined4 *)(this + 8) = 0;
return this;
}
piVar3 = (int *)(**(code **)(*(int *)param_2 + 0x9b4))(param_2);
(**(code **)(*piVar3 + 0xc4))(piVar3,pCVar8,2,0x3f800000,0,"Aiming at victim",1,0x3e800000);
cVar2 = (**(code **)(*piVar5 + 0x33c))(piVar5);
if (cVar2 != '\0') {
this_01 = ::operator_new(0x48);
/* try { // try from 00ac791d to 00ac7921 has its CatchHandler @ 00ac7989 */
SmokerTongueVictim::SmokerTongueVictim(this_01,pCVar8);
*(undefined4 *)this = 1;
*(SmokerTongueVictim **)(this + 4) = this_01;
*(char **)(this + 8) = "Victim is close, attack!";
return this;
}
uVar1 = *(uint *)(param_1 + 0x34);
if (((uVar1 != 0xffffffff) &&
(puVar6 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar6 != (undefined *)0xfffffffc)) &&
((*(uint *)(puVar6 + 8) == uVar1 >> 0xc && (*(int *)(puVar6 + 4) != 0)))) {
if (*(int *)(pCVar8 + 0x30) == 0) {
iVar4 = 0;
}
else {
iVar4 = *(int *)(pCVar8 + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
}
iVar7 = *(int *)(*(int *)(puVar6 + 4) + 0x30);
if (iVar7 == 0) {
iVar7 = 0;
}
else {
iVar7 = iVar7 - *(int *)(gpGlobals + 0x58) >> 4;
}
if (iVar4 == iVar7) goto LAB_00ac7829;
}
this_00 = ::operator_new(0x4830);
/* try { // try from 00ac77cf to 00ac77d3 has its CatchHandler @ 00ac7977 */
SmokerMoveToAttackPosition(this_00,pCVar8);
*(undefined4 *)this = 1;
*(SmokerMoveToAttackPosition **)(this + 4) = this_00;
*(char **)(this + 8) = "Changing to new victim";
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.