L L4D2node

CPointProximitySensor::Think

0x007d7590 · 523 bytes · __thiscall

_ZN21CPointProximitySensor5ThinkEv

Decompiled

undefined (1 param)

/* CPointProximitySensor::Think() */

void __thiscall CPointProximitySensor::Think(CPointProximitySensor *this)

{
  uint uVar1;
  undefined4 *puVar2;
  uint uVar3;
  CBaseEntity *this_00;
  longdouble lVar4;
  float local_40;
  float local_3c;
  float local_38;
  float local_34;
  float local_30;
  float local_2c;
  float local_28;
  undefined4 local_24;
  undefined4 local_20;
  
  uVar1 = *(uint *)(this + 0x444);
  if (uVar1 == 0xffffffff) {
    return;
  }
  uVar3 = uVar1 & 0xfff;
  puVar2 = (undefined4 *)(g_pEntityList + uVar3 * 0x10 + 4);
  if (puVar2 == (undefined4 *)0x0) {
    return;
  }
  if (*(uint *)(g_pEntityList + uVar3 * 0x10 + 8) != uVar1 >> 0xc) {
    return;
  }
  if (*(int *)(g_pEntityList + uVar3 * 0x10 + 4) == 0) {
    return;
  }
  if (((byte)this[0x14d] & 8) != 0) {
    this_00 = (CBaseEntity *)0x0;
    CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
    uVar1 = *(uint *)(this + 0x444);
    if (((uVar1 == 0xffffffff) ||
        (puVar2 = (undefined4 *)(g_pEntityList + (uVar1 & 0xfff) * 0x10 + 4),
        puVar2 == (undefined4 *)0x0)) || (puVar2[1] != uVar1 >> 0xc)) goto LAB_007d75ee;
  }
  this_00 = (CBaseEntity *)*puVar2;
LAB_007d75ee:
  if (((byte)this_00[0x14d] & 8) != 0) {
    CBaseEntity::CalcAbsolutePosition(this_00);
  }
  local_3c = *(float *)(this_00 + 0x2e0) - *(float *)(this + 0x2e0);
  local_38 = *(float *)(this_00 + 0x2e4) - *(float *)(this + 0x2e4);
  local_34 = *(float *)(this_00 + 0x2e8) - *(float *)(this + 0x2e8);
  lVar4 = (longdouble)VectorNormalize((Vector *)&local_3c);
  local_40 = (float)lVar4;
  if (((byte)this[0x148] & 1) != 0) {
    (**(code **)(*(int *)this + 0x24c))(this,&local_30,0,0);
    local_40 = local_40 * ABS(local_2c * local_38 + local_30 * local_3c + local_28 * local_34);
  }
  variant_t::Set((variant_t *)(this + 0x448),1,&local_40);
  local_30 = *(float *)(this + 0x448);
  local_2c = *(float *)(this + 0x44c);
  local_28 = *(float *)(this + 0x450);
  local_24 = *(undefined4 *)(this + 0x454);
  local_20 = *(undefined4 *)(this + 0x458);
  CBaseEntityOutput::FireOutput((CBaseEntityOutput *)(this + 0x448),&local_30,this,this,0);
  CBaseEntity::SetNextThink((CBaseEntity *)this,*(float *)(gpGlobals + 0xc),(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)