Vocalizer::OnUse
0x00a091a0 · 854 bytes · __thiscall
_ZN9Vocalizer5OnUseEv
Decompiled
undefined (1 param)
/* Vocalizer::OnUse() */
undefined4 __thiscall Vocalizer::OnUse(Vocalizer *this)
{
CBaseEntity *this_00;
uint uVar1;
char cVar2;
int iVar3;
undefined4 uVar4;
int *piVar5;
undefined4 *puVar6;
CCSPlayer *this_01;
undefined *puVar7;
uint uVar8;
int *piVar9;
CBaseEntity *this_02;
if (((byte)(*(CBaseEntity **)this)[0x1cb4] & 0x20) == 0) {
return 0;
}
iVar3 = CBaseEntity::GetTeamNumber(*(CBaseEntity **)this);
uVar4 = IsASurvivorTeam(iVar3);
if ((char)uVar4 == '\0') {
return 0;
}
this_00 = *(CBaseEntity **)this;
uVar1 = *(uint *)(this_00 + 0x1d14);
if ((((uVar1 != 0xffffffff) &&
(puVar7 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar7 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar7 + 8) == uVar1 >> 0xc)) && (*(int *)(puVar7 + 4) != 0)) {
return 0;
}
uVar1 = *(uint *)(this + 0x118);
if (((uVar1 != 0xffffffff) &&
(puVar7 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar7 != (undefined *)0xfffffffc)) &&
((*(uint *)(puVar7 + 8) == uVar1 >> 0xc && (*(int *)(puVar7 + 4) != 0)))) {
Say(this,"PlayerLook",1,0);
return uVar4;
}
uVar1 = *(uint *)(this + 0x11c);
if (uVar1 == 0xffffffff) {
return 0;
}
uVar8 = uVar1 & 0xfff;
puVar6 = (undefined4 *)(g_pEntityList + uVar8 * 0x10 + 4);
if (puVar6 == (undefined4 *)0x0) {
return 0;
}
if (*(uint *)(g_pEntityList + uVar8 * 0x10 + 8) != uVar1 >> 0xc) {
return 0;
}
if (*(int *)(g_pEntityList + uVar8 * 0x10 + 4) == 0) {
return 0;
}
if (((byte)this_00[0x14d] & 8) == 0) {
LAB_00a09292:
this_02 = (CBaseEntity *)*puVar6;
}
else {
this_02 = (CBaseEntity *)0x0;
CBaseEntity::CalcAbsolutePosition(this_00);
uVar1 = *(uint *)(this + 0x11c);
if (((uVar1 != 0xffffffff) &&
(puVar6 = (undefined4 *)(g_pEntityList + (uVar1 & 0xfff) * 0x10 + 4),
puVar6 != (undefined4 *)0x0)) && (puVar6[1] == uVar1 >> 0xc)) goto LAB_00a09292;
}
if (((byte)this_02[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition(this_02);
}
if ((((*(float *)(this_02 + 0x2e0) - *(float *)(this_00 + 0x2e0)) *
(*(float *)(this_02 + 0x2e0) - *(float *)(this_00 + 0x2e0)) +
(*(float *)(this_02 + 0x2e4) - *(float *)(this_00 + 0x2e4)) *
(*(float *)(this_02 + 0x2e4) - *(float *)(this_00 + 0x2e4)) +
(*(float *)(this_02 + 0x2e8) - *(float *)(this_00 + 0x2e8)) *
(*(float *)(this_02 + 0x2e8) - *(float *)(this_00 + 0x2e8)) < 250000.0) &&
(piVar5 = (int *)CCSPlayer::GetActiveCSWeapon(*(CCSPlayer **)this), piVar5 != (int *)0x0)) &&
(((iVar3 = (**(code **)(*piVar5 + 0x638))(piVar5), iVar3 == 0xc ||
(((iVar3 = (**(code **)(*piVar5 + 0x638))(piVar5), iVar3 == 0xf ||
(iVar3 = (**(code **)(*piVar5 + 0x638))(piVar5), iVar3 == 0xe)) ||
(iVar3 = (**(code **)(*piVar5 + 0x638))(piVar5), iVar3 == 0xd)))) ||
(iVar3 = (**(code **)(*piVar5 + 0x638))(piVar5), iVar3 == 0x19)))) {
piVar9 = (int *)0x0;
uVar1 = *(uint *)(this + 0x11c);
if (((uVar1 != 0xffffffff) &&
(puVar7 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar7 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar7 + 8) == uVar1 >> 0xc)) {
piVar9 = *(int **)(puVar7 + 4);
}
cVar2 = (**(code **)(*piVar9 + 0x480))(piVar9,piVar5);
if (cVar2 == '\0') {
LAB_00a09425:
Say(this,"PlayerItemForYou",1,0);
return uVar4;
}
iVar3 = (**(code **)(*piVar5 + 0x638))(piVar5);
if ((iVar3 == 0xc) || (iVar3 = (**(code **)(*piVar5 + 0x638))(piVar5), iVar3 == 0xf)) {
iVar3 = (**(code **)(*piVar5 + 0x638))(piVar5);
this_01 = (CCSPlayer *)0x0;
uVar1 = *(uint *)(this + 0x11c);
if ((uVar1 != 0xffffffff) &&
((puVar7 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar7 != (undefined *)0xfffffffc &&
(*(uint *)(puVar7 + 8) == uVar1 >> 0xc)))) {
this_01 = *(CCSPlayer **)(puVar7 + 4);
}
iVar3 = CCSPlayer::GetCSWeapon(this_01,iVar3);
if (iVar3 == 0) goto LAB_00a09425;
}
}
return 0;
}
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.