CEnvWeaponfire::EstablishTarget
0x008ccc00 · 460 bytes · __thiscall
_ZN14CEnvWeaponfire15EstablishTargetEv
Decompiled
undefined (1 param)
/* CEnvWeaponfire::EstablishTarget() */
undefined4 __thiscall CEnvWeaponfire::EstablishTarget(CEnvWeaponfire *this)
{
int *piVar1;
char cVar2;
undefined4 uVar3;
int iVar4;
uint uVar5;
uint *puVar6;
CBaseEntity *pCVar7;
undefined *puVar8;
int iVar9;
pCVar7 = (CBaseEntity *)0x0;
uVar5 = *(uint *)(this + 0x45c);
if (((uVar5 != 0xffffffff) &&
(puVar8 = g_pEntityList + (uVar5 & 0xfff) * 0x10, puVar8 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar8 + 8) == uVar5 >> 0xc)) {
pCVar7 = *(CBaseEntity **)(puVar8 + 4);
}
uVar3 = IsValidTarget(this,pCVar7);
if ((char)uVar3 != '\0') {
return uVar3;
}
iVar9 = 1;
*(undefined4 *)(this + 0x45c) = 0xffffffff;
if (0 < *(int *)(gpGlobals + 0x14)) {
do {
pCVar7 = (CBaseEntity *)UTIL_PlayerByIndex(iVar9);
if (((((pCVar7 != (CBaseEntity *)0x0) && (*(int *)(pCVar7 + 0x30) != 0)) &&
((*(int *)(pCVar7 + 0x30) - *(int *)(gpGlobals + 0x58) >> 4 != 0 &&
((cVar2 = (**(code **)(*(int *)pCVar7 + 0x16c))(pCVar7), cVar2 != '\0' &&
(*(int *)(pCVar7 + 0x1f6c) != 2)))))) &&
(iVar4 = (**(code **)(*(int *)pCVar7 + 0x148))(pCVar7), iVar4 == 0)) &&
(cVar2 = IsValidTarget(this,pCVar7), cVar2 != '\0')) goto LAB_008ccd28;
iVar9 = iVar9 + 1;
} while (iVar9 <= *(int *)(gpGlobals + 0x14));
}
iVar9 = TheNextBots();
uVar5 = (uint)*(ushort *)(iVar9 + 0x10);
if (uVar5 != 0xffff) {
iVar4 = *(int *)(iVar9 + 4);
do {
piVar1 = *(int **)(iVar4 + uVar5 * 8);
pCVar7 = (CBaseEntity *)(**(code **)(*piVar1 + 0xb4))(piVar1);
cVar2 = IsValidTarget(this,pCVar7);
if (cVar2 != '\0') {
if (pCVar7 != (CBaseEntity *)0x0) {
LAB_008ccd28:
puVar6 = (uint *)(**(code **)(*(int *)pCVar7 + 0xc))(pCVar7);
puVar8 = g_pEntityList;
uVar5 = *puVar6;
*(uint *)(this + 0x45c) = uVar5;
if (uVar5 == 0xffffffff) {
return uVar3;
}
puVar8 = puVar8 + (uVar5 & 0xfff) * 0x10;
if (puVar8 == (undefined *)0xfffffffc) {
return uVar3;
}
if (*(uint *)(puVar8 + 8) != uVar5 >> 0xc) {
return uVar3;
}
return CONCAT31((int3)((uint)*(int *)(puVar8 + 4) >> 8),*(int *)(puVar8 + 4) != 0);
}
break;
}
iVar4 = *(int *)(iVar9 + 4);
uVar5 = (uint)*(ushort *)(iVar4 + 6 + uVar5 * 8);
} while (uVar5 != 0xffff);
}
*(undefined4 *)(this + 0x45c) = 0xffffffff;
return uVar3;
}
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.