CTriggerActiveWeaponDetect::ActiveWeaponThink
0x00b149e0 · 316 bytes · __thiscall
_ZN26CTriggerActiveWeaponDetect17ActiveWeaponThinkEv
Decompiled
undefined (1 param)
/* CTriggerActiveWeaponDetect::ActiveWeaponThink() */
void __thiscall CTriggerActiveWeaponDetect::ActiveWeaponThink(CTriggerActiveWeaponDetect *this)
{
int iVar1;
uint uVar2;
char cVar3;
int iVar4;
char *pcVar5;
undefined *puVar6;
char *pcVar7;
int iVar8;
CBaseCombatCharacter *this_00;
undefined1 local_24 [20];
iVar1 = *(int *)(this + 0x560);
if (0 < iVar1) {
iVar8 = 0;
do {
while ((((uVar2 = *(uint *)(*(int *)(this + 0x554) + iVar8 * 4), uVar2 == 0xffffffff ||
(puVar6 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar6 == (undefined *)0xfffffffc))
|| (*(uint *)(puVar6 + 8) != uVar2 >> 0xc)) ||
((this_00 = *(CBaseCombatCharacter **)(puVar6 + 4),
this_00 == (CBaseCombatCharacter *)0x0 ||
(cVar3 = (**(code **)(*(int *)this_00 + 0x16c))(this_00), cVar3 == '\0'))))) {
LAB_00b14a10:
iVar8 = iVar8 + 1;
if (iVar8 == iVar1) goto LAB_00b14ae0;
}
cVar3 = (**(code **)(*(int *)this_00 + 0x16c))(this_00);
if (cVar3 == '\0') {
this_00 = (CBaseCombatCharacter *)0x0;
}
iVar4 = CBaseCombatCharacter::GetActiveWeapon(this_00);
if (iVar4 == 0) goto LAB_00b14a10;
pcVar5 = *(char **)(this + 0x584);
if (pcVar5 == (char *)0x0) {
pcVar5 = "";
}
pcVar7 = "";
if (*(char **)(iVar4 + 0x7c) != (char *)0x0) {
pcVar7 = *(char **)(iVar4 + 0x7c);
}
iVar4 = _V_strcmp(pcVar7,pcVar5);
if (iVar4 != 0) goto LAB_00b14a10;
iVar8 = iVar8 + 1;
COutputEvent::FireOutput
((COutputEvent *)(this + 0x56c),(CBaseEntity *)this_00,(CBaseEntity *)this,0.0);
} while (iVar8 != iVar1);
LAB_00b14ae0:
CBaseEntity::ThinkSet((_func_void *)local_24,(float)this,(char *)ActiveWeaponThink);
}
return;
}
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.