L L4D2node

TargetScan<CTerrorPlayer>::operator()

0x004d73f0 · 1264 bytes · __thiscall

_ZN10TargetScanI13CTerrorPlayerEclEPS0_

Decompiled

undefined (2 params)

/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* TargetScan<CTerrorPlayer>::TEMPNAMEPLACEHOLDERVALUE(CTerrorPlayer*) */

undefined4 __thiscall
TargetScan<CTerrorPlayer>::operator()(TargetScan<CTerrorPlayer> *this,CTerrorPlayer *param_1)

{
  code *pcVar1;
  CTerrorPlayer *pCVar2;
  char cVar3;
  int iVar4;
  int iVar5;
  Vector *pVVar6;
  int iVar7;
  int *piVar8;
  longdouble lVar9;
  float fVar10;
  float local_70;
  float local_6c;
  float local_68;
  float local_64;
  float local_60;
  float local_5c;
  float local_58;
  float local_54;
  float local_50;
  Vector local_4c [12];
  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 (___atan2f_finite == 0) {
    iVar7 = 0;
  }
  else {
    (**(code **)(___atan2f_finite + 0x50))();
    iVar7 = ___atan2f_finite;
  }
  iVar4 = _DAT_0105db00;
                    /* try { // try from 004d7546 to 004d7594 has its CatchHandler @ 004d7920 */
  if (((_DAT_0105d154 != 0) || (DAT_0105d158 == '\0')) &&
     (iVar5 = ThreadGetCurrentId(), iVar4 == iVar5)) {
    if ((char *)*_DAT_0105d15c != "TargetScan()") {
      _DAT_0105d15c =
           (int *)CVProfNode::GetSubNode((char *)_DAT_0105d15c,0xc21c72,(char *)0x1,0xbfafa1);
    }
    CVProfNode::EnterScope();
    DAT_0105d158 = '\0';
  }
  piVar8 = (int *)&stack0xffffff34;
                    /* try { // try from 004d74b4 to 004d74d2 has its CatchHandler @ 004d78ff */
                    /* try { // try from 004d760c to 004d78eb has its CatchHandler @ 004d78ff */
  if ((((*(CTerrorPlayer **)(this + 4) != param_1) &&
       (cVar3 = (**(code **)(*(int *)param_1 + 300))(), piVar8 = (int *)&stack0xffffff34,
       cVar3 != '\0')) &&
      ((*(int *)(this + 0x14) == -1 ||
       (iVar4 = CBaseEntity::GetTeamNumber((CBaseEntity *)param_1), piVar8 = (int *)&stack0xffffff34
       , iVar4 == *(int *)(this + 0x14))))) &&
     (cVar3 = (**(code **)(*(int *)this + 0xc))(), piVar8 = (int *)&stack0xffffff34, cVar3 != '\0'))
  {
    (**(code **)(**(int **)(this + 4) + 0x234))();
    fVar10 = *(float *)(this + 0x24);
    local_54 = *(float *)(this + 0xc) * fVar10 + local_60;
    local_50 = *(float *)(this + 0x10) * fVar10 + local_5c;
    local_58 = fVar10 * *(float *)(this + 8) + local_64;
    pVVar6 = (Vector *)(**(code **)(*(int *)param_1 + 0x288))();
    CalcClosestPointOnLineSegment
              (pVVar6,(Vector *)&local_64,(Vector *)&local_58,local_4c,(float *)0x0);
    pCVar2 = param_1;
    if (((byte)param_1[0x14d] & 8) != 0) {
      CBaseEntity::CalcAbsolutePosition((CBaseEntity *)param_1);
    }
    local_64 = *(float *)(pCVar2 + 0x2e0);
    local_60 = *(float *)(pCVar2 + 0x2e4);
    local_5c = *(float *)(pCVar2 + 0x2e8);
    local_58 = local_64;
    local_54 = local_60;
    local_50 = local_5c;
    iVar4 = (**(code **)(*(int *)(param_1 + 0x194) + 8))();
    local_50 = local_50 + *(float *)(iVar4 + 8);
    CalcClosestPointOnLineSegment
              (local_4c,(Vector *)&local_64,(Vector *)&local_58,(Vector *)&local_70,(float *)0x0);
    if (this[0x28] != (TargetScan<CTerrorPlayer>)0x0) {
      NDebugOverlay::Cross3D((Vector *)&local_70,1.0,0xff,0xff,0xff,true,-1.0);
      NDebugOverlay::Line((Vector *)&local_58,(Vector *)&local_64,0xff,0,0,true,-1.0);
    }
    (**(code **)(**(int **)(this + 4) + 0x234))();
    local_40 = local_70 - local_28;
    local_3c = local_6c - local_24;
    local_38 = local_68 - local_20;
    VectorNormalize((Vector *)&local_40);
    CCollisionProperty::CalcNearestPoint
              ((CCollisionProperty *)(*(int *)(this + 4) + 0x194),(Vector *)&local_70,
               (Vector *)&local_34);
    CCollisionProperty::CalcNearestPoint
              ((CCollisionProperty *)(param_1 + 0x194),(Vector *)&local_34,(Vector *)&local_28);
    fVar10 = SQRT((local_2c - local_20) * (local_2c - local_20) +
                  (local_30 - local_24) * (local_30 - local_24) +
                  (local_34 - local_28) * (local_34 - local_28));
    piVar8 = (int *)&stack0xffffff2c;
    if (fVar10 < *(float *)(this + 0x20) || fVar10 == *(float *)(this + 0x20)) {
      lVar9 = (longdouble)(**(code **)(*(int *)this + 4))();
      fVar10 = (float)lVar9;
      piVar8 = (int *)&stack0xffffff2c;
      if ((*(float *)(this + 0x18) <= fVar10 && fVar10 != *(float *)(this + 0x18)) &&
         (cVar3 = (**(code **)(*(int *)this + 8))(), piVar8 = (int *)&stack0xffffff2c, cVar3 != '\0'
         )) {
        if (*(float *)(this + 0x1c) <= fVar10) {
          *(float *)(this + 0x1c) = fVar10;
          *(CTerrorPlayer **)(this + 0x2c) = param_1;
        }
        CUtlVector<CTerrorPlayer*,CUtlMemory<CTerrorPlayer*,int>>::InsertBefore
                  ((CUtlVector<CTerrorPlayer*,CUtlMemory<CTerrorPlayer*,int>> *)(this + 0x30),
                   *(int *)(this + 0x3c),&param_1);
        piVar8 = (int *)&stack0xffffff2c;
      }
    }
  }
  iVar4 = _DAT_0105db00;
  if ((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) {
    piVar8[-1] = 0x4d75b3;
    iVar5 = ThreadGetCurrentId();
    if (iVar4 == iVar5) {
      *piVar8 = (int)_DAT_0105d15c;
      piVar8[-1] = 0x4d75c8;
      cVar3 = CVProfNode::ExitScope();
      if (cVar3 != '\0') {
        _DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
      }
      DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
    }
  }
  if (iVar7 != 0) {
    piVar8[5] = 0;
    piVar8[4] = 0;
    piVar8[3] = 0;
    *piVar8 = iVar7;
    piVar8[1] = 0;
    piVar8[2] = 0;
    pcVar1 = *(code **)(iVar7 + 0x54);
    piVar8[-1] = 0x4d752d;
    (*pcVar1)();
  }
  return 1;
}

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)