CPointAngleSensor::InputSetTargetEntity
0x007d77b0 · 358 bytes · __thiscall
_ZN17CPointAngleSensor20InputSetTargetEntityER11inputdata_t
Decompiled
undefined (2 params)
/* CPointAngleSensor::InputSetTargetEntity(inputdata_t&) */
void __thiscall
CPointAngleSensor::InputSetTargetEntity(CPointAngleSensor *this,inputdata_t *param_1)
{
uint uVar1;
int iVar2;
char *pcVar3;
int *piVar4;
undefined4 *puVar5;
undefined *puVar6;
char *local_20 [4];
if (*(int *)(param_1 + 0x18) == 2) {
pcVar3 = *(char **)(param_1 + 8);
}
else {
iVar2 = variant_t::ToString((variant_t *)(param_1 + 8));
if ((iVar2 == 0) || (pcVar3 = *(char **)(param_1 + 8), *(int *)(param_1 + 0x18) != 2))
goto LAB_007d77dd;
}
if ((pcVar3 != (char *)0x0) && (*pcVar3 != '\0')) {
AllocPooledString((char *)local_20);
*(char **)(this + 0xf8) = local_20[0];
pcVar3 = "";
if (local_20[0] != (char *)0x0) {
pcVar3 = local_20[0];
}
piVar4 = (int *)CGlobalEntityList::FindEntityByName
((CGlobalEntityList *)gEntList,(CBaseEntity *)0x0,pcVar3,
(CBaseEntity *)0x0,*(CBaseEntity **)param_1,
*(CBaseEntity **)(param_1 + 4),(IEntityFindFilter *)0x0);
if (piVar4 == (int *)0x0) {
*(undefined4 *)(this + 0x448) = 0xffffffff;
}
else {
puVar5 = (undefined4 *)(**(code **)(*piVar4 + 0xc))(piVar4);
*(undefined4 *)(this + 0x448) = *puVar5;
}
if (this[0x440] != (CPointAngleSensor)0x0) {
return;
}
uVar1 = *(uint *)(this + 0x448);
if (uVar1 == 0xffffffff) {
return;
}
puVar6 = g_pEntityList + (uVar1 & 0xfff) * 0x10;
if (puVar6 == (undefined *)0xfffffffc) {
return;
}
if (*(uint *)(puVar6 + 8) != uVar1 >> 0xc) {
return;
}
if (*(int *)(puVar6 + 4) == 0) {
return;
}
CBaseEntity::SetNextThink((CBaseEntity *)this,*(float *)(gpGlobals + 0xc),(char *)0x0);
return;
}
LAB_007d77dd:
*(undefined4 *)(this + 0xf8) = 0;
*(undefined4 *)(this + 0x448) = 0xffffffff;
CBaseEntity::SetNextThink((CBaseEntity *)this,-1.0,(char *)0x0);
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.