L L4D2node

CTriggerProximity::MeasureThink

0x00b159e0 · 693 bytes · __thiscall

_ZN17CTriggerProximity12MeasureThinkEv

Decompiled

undefined (1 param)

/* CTriggerProximity::MeasureThink() */

void __thiscall CTriggerProximity::MeasureThink(CTriggerProximity *this)

{
  uint uVar1;
  int iVar2;
  char cVar3;
  uint *puVar4;
  int iVar5;
  undefined *puVar6;
  uint *puVar7;
  float fVar8;
  float fVar9;
  float fVar10;
  int local_54;
  float local_4c;
  undefined1 local_44 [16];
  float local_34;
  undefined4 local_30;
  undefined4 local_2c;
  undefined4 local_28;
  undefined4 local_24;
  undefined4 local_20;
  
  uVar1 = *(uint *)(this + 0x56c);
  if ((((uVar1 == 0xffffffff) ||
       (puVar6 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar6 == (undefined *)0xfffffffc)) ||
      (*(uint *)(puVar6 + 8) != uVar1 >> 0xc)) ||
     ((*(int *)(puVar6 + 4) == 0 || (*(int *)(*(int *)(puVar6 + 4) + 0x30) == 0)))) {
    CBaseEntity::ThinkSet((_func_void *)local_44,(float)this,(char *)0x0);
    CBaseEntity::SetNextThink((CBaseEntity *)this,-1.0,(char *)0x0);
    return;
  }
  local_4c = *(float *)(this + 0x574) + 100.0;
  puVar4 = (uint *)CBaseEntity::GetDataObject((CBaseEntity *)this,1);
  if (puVar4 == (uint *)0x0) {
    local_54 = 0;
LAB_00b15bd3:
    if ((local_4c <= *(float *)(this + 0x574)) &&
       (local_4c = local_4c / *(float *)(this + 0x574), local_4c != *(float *)(this + 0x57c))) {
      local_34 = local_4c;
      variant_t::Set((variant_t *)(this + 0x57c),1,&local_34);
      local_30 = *(undefined4 *)(this + 0x57c);
      local_2c = *(undefined4 *)(this + 0x580);
      local_28 = *(undefined4 *)(this + 0x584);
      local_24 = *(undefined4 *)(this + 0x588);
      local_20 = *(undefined4 *)(this + 0x58c);
      CBaseEntityOutput::FireOutput((CBaseEntityOutput *)(this + 0x57c),&local_30,local_54,this,0);
    }
    CBaseEntity::SetNextThink((CBaseEntity *)this,*(float *)(gpGlobals + 0xc),(char *)0x0);
    return;
  }
  local_54 = 0;
  puVar7 = (uint *)puVar4[2];
joined_r0x00b15abd:
  if (puVar4 != puVar7) {
    do {
      uVar1 = *puVar7;
      if (((uVar1 != 0xffffffff) &&
          (puVar6 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar6 != (undefined *)0xfffffffc)) &&
         ((*(uint *)(puVar6 + 8) == uVar1 >> 0xc &&
          ((iVar2 = *(int *)(puVar6 + 4), iVar2 != 0 &&
           (cVar3 = (**(code **)(*(int *)this + 0x34c))(this,iVar2), cVar3 != '\0')))))) {
        uVar1 = *(uint *)(this + 0x56c);
        iVar5 = 0;
        if ((uVar1 != 0xffffffff) &&
           ((puVar6 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar6 != (undefined *)0xfffffffc &&
            (*(uint *)(puVar6 + 8) == uVar1 >> 0xc)))) {
          iVar5 = *(int *)(puVar6 + 4);
        }
        fVar10 = *(float *)(iVar2 + 0x39c) - *(float *)(iVar5 + 0x39c);
        fVar8 = *(float *)(iVar2 + 0x3a0) - *(float *)(iVar5 + 0x3a0);
        fVar9 = *(float *)(iVar2 + 0x3a4) - *(float *)(iVar5 + 0x3a4);
        fVar8 = SQRT(fVar8 * fVar8 + fVar10 * fVar10 + fVar9 * fVar9);
        if (fVar8 < local_4c) goto code_r0x00b15bbc;
      }
      puVar7 = (uint *)puVar7[2];
      if (puVar4 == puVar7) break;
    } while( true );
  }
  goto LAB_00b15bd3;
code_r0x00b15bbc:
  puVar7 = (uint *)puVar7[2];
  local_4c = fVar8;
  local_54 = iVar2;
  goto joined_r0x00b15abd;
}

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)