L L4D2node

CPointProximitySensor::InputSetTargetEntity

0x007d7920 · 358 bytes · __thiscall

_ZN21CPointProximitySensor20InputSetTargetEntityER11inputdata_t

Decompiled

undefined (2 params)

/* CPointProximitySensor::InputSetTargetEntity(inputdata_t&) */

void __thiscall
CPointProximitySensor::InputSetTargetEntity(CPointProximitySensor *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_007d794d;
  }
  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 + 0x444) = 0xffffffff;
    }
    else {
      puVar5 = (undefined4 *)(**(code **)(*piVar4 + 0xc))(piVar4);
      *(undefined4 *)(this + 0x444) = *puVar5;
    }
    if (this[0x440] != (CPointProximitySensor)0x0) {
      return;
    }
    uVar1 = *(uint *)(this + 0x444);
    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_007d794d:
  *(undefined4 *)(this + 0xf8) = 0;
  *(undefined4 *)(this + 0x444) = 0xffffffff;
  CBaseEntity::SetNextThink((CBaseEntity *)this,-1.0,(char *)0x0);
  return;
}

SourceMod gamedata

paste into addons/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.



        

        

          

Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.

Return-type handling cheatsheet (DHookReturn)