L L4D2node

CTriggerLook::Touch

0x00b18270 · 855 bytes · __thiscall

_ZN12CTriggerLook5TouchEP11CBaseEntity

Decompiled

undefined (2 params)

/* CTriggerLook::Touch(CBaseEntity*) */

void __thiscall CTriggerLook::Touch(CTriggerLook *this,CBaseEntity *param_1)

{
  uint uVar1;
  int iVar2;
  code *pcVar3;
  char cVar4;
  int *piVar5;
  uint *puVar6;
  undefined *puVar7;
  int iVar8;
  float fVar9;
  undefined4 local_60;
  float local_40;
  float local_3c;
  float local_38;
  float local_34;
  float local_30;
  float local_2c;
  float local_28;
  float local_24;
  float local_20;
  
  if (this[0x5d8] != (CTriggerLook)0x0) {
    return;
  }
  uVar1 = *(uint *)(this + 0x5c0);
  if ((((uVar1 == 0xffffffff) ||
       (puVar7 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar7 == (undefined *)0xfffffffc)) ||
      (*(uint *)(puVar7 + 8) != uVar1 >> 0xc)) || (*(int *)(puVar7 + 4) == 0)) {
    local_60 = 0xb182bd;
    piVar5 = (int *)CBaseEntity::GetNextTarget((CBaseEntity *)this);
    if (piVar5 == (int *)0x0) {
      *(undefined4 *)(this + 0x5c0) = 0xffffffff;
      return;
    }
    local_60 = 0xb182cd;
    puVar6 = (uint *)(**(code **)(*piVar5 + 0xc))();
    puVar7 = g_pEntityList;
    uVar1 = *puVar6;
    *(uint *)(this + 0x5c0) = uVar1;
    if (uVar1 == 0xffffffff) {
      return;
    }
    puVar7 = puVar7 + (uVar1 & 0xfff) * 0x10;
    if (puVar7 == (undefined *)0xfffffffc) {
      return;
    }
    if (*(uint *)(puVar7 + 8) != uVar1 >> 0xc) {
      return;
    }
    if (*(int *)(puVar7 + 4) == 0) {
      return;
    }
  }
  local_60 = 0xb18326;
  cVar4 = (**(code **)(*(int *)this + 0x34c))();
  if (cVar4 != '\0') {
    local_60 = 0xb18335;
    cVar4 = (**(code **)(*(int *)param_1 + 0x16c))();
    if (cVar4 != '\0') {
      if (((byte)this[0x149] & 1) == 0) {
        local_60 = 0xb185b2;
        (**(code **)(*(int *)param_1 + 0x3fc))();
        local_40 = local_28;
        piVar5 = &local_60;
        local_3c = local_24;
        local_38 = local_20;
      }
      else {
        if (((byte)param_1[0x14d] & 0x10) != 0) {
          local_60 = 0xb185e8;
          CBaseEntity::CalcAbsoluteVelocity(param_1);
        }
        local_40 = *(float *)(param_1 + 0x274);
        local_3c = *(float *)(param_1 + 0x278);
        local_38 = *(float *)(param_1 + 0x27c);
        piVar5 = (int *)&stack0xffffffa4;
        if (((local_40 == vec3_origin) &&
            (piVar5 = (int *)&stack0xffffffa4, local_3c == DAT_01053d4c)) &&
           (piVar5 = (int *)&stack0xffffffa4, local_38 == DAT_01053d50)) {
          local_60 = 0xb18528;
          cVar4 = (**(code **)(*(int *)param_1 + 0x4fc))();
          piVar5 = (int *)&stack0xffffffa4;
          if (cVar4 != '\0') {
            local_60 = 0xb1853e;
            piVar5 = (int *)(**(code **)(*(int *)param_1 + 0x500))();
            local_60 = 0xb18546;
            piVar5 = (int *)(**(code **)(*piVar5 + 0x20))();
            local_60 = 0xb18555;
            (**(code **)(*piVar5 + 600))();
            local_40 = local_28;
            local_3c = local_24;
            local_38 = local_20;
            piVar5 = &local_60;
          }
        }
        *piVar5 = (int)&local_40;
        piVar5[-1] = 0xb1839e;
        VectorNormalize((Vector *)*piVar5);
      }
      iVar2 = *(int *)param_1;
      *piVar5 = (int)&local_28;
      iVar8 = 0;
      piVar5[1] = (int)param_1;
      pcVar3 = *(code **)(iVar2 + 0x234);
      piVar5[-1] = 0xb183b1;
      (*pcVar3)();
      uVar1 = *(uint *)(this + 0x5c0);
      if (((uVar1 != 0xffffffff) &&
          (puVar7 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar7 != (undefined *)0xfffffffc)) &&
         (*(uint *)(puVar7 + 8) == uVar1 >> 0xc)) {
        iVar8 = *(int *)(puVar7 + 4);
      }
      if ((*(byte *)(iVar8 + 0x14d) & 8) != 0) {
        piVar5[-1] = iVar8;
        piVar5[-2] = 0xb18598;
        CBaseEntity::CalcAbsolutePosition((CBaseEntity *)piVar5[-1]);
      }
      local_34 = *(float *)(iVar8 + 0x2e0) - local_28;
      local_30 = *(float *)(iVar8 + 0x2e4) - local_24;
      local_2c = *(float *)(iVar8 + 0x2e8);
      piVar5[-1] = (int)&local_34;
      local_2c = local_2c - local_20;
      piVar5[-2] = 0xb18433;
      VectorNormalize((Vector *)piVar5[-1]);
      iVar2 = gpGlobals;
      fVar9 = local_30 * local_3c + local_34 * local_40 + local_2c * local_38;
      if (fVar9 < *(float *)(this + 0x5c4) || fVar9 == *(float *)(this + 0x5c4)) {
        *(undefined4 *)(this + 0x5cc) = 0xbf800000;
      }
      else {
        if (*(float *)(this + 0x5cc) == -1.0) {
          *(undefined4 *)(this + 0x5d0) = *(undefined4 *)(gpGlobals + 0xc);
          fVar9 = 0.0;
          *(undefined4 *)(this + 0x5cc) = 0;
        }
        else {
          fVar9 = (*(float *)(this + 0x5cc) + *(float *)(gpGlobals + 0xc)) -
                  *(float *)(this + 0x5d0);
          *(float *)(this + 0x5cc) = fVar9;
          *(undefined4 *)(this + 0x5d0) = *(undefined4 *)(iVar2 + 0xc);
        }
        if (*(float *)(this + 0x5c8) <= fVar9) {
          piVar5[1] = 0;
          *piVar5 = (int)param_1;
          piVar5[-1] = (int)this;
          piVar5[-2] = 0xb184bd;
          Trigger((CTriggerLook *)piVar5[-1],(CBaseEntity *)*piVar5,*(bool *)(piVar5 + 1));
        }
      }
    }
  }
  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)