L L4D2node

CBaseEntity::PhysicsMarkEntityAsTouched

0x00476220 · 860 bytes · __thiscall

_ZN11CBaseEntity26PhysicsMarkEntityAsTouchedEPS_

Decompiled

undefined (2 params)

/* CBaseEntity::PhysicsMarkEntityAsTouched(CBaseEntity*) */

uint * __thiscall CBaseEntity::PhysicsMarkEntityAsTouched(CBaseEntity *this,CBaseEntity *param_1)

{
  uint uVar1;
  int iVar2;
  undefined4 uVar3;
  uint *puVar4;
  uint *puVar5;
  undefined4 uVar6;
  undefined4 uVar7;
  uint *puVar8;
  undefined *puVar9;
  int iVar10;
  CBaseEntity *pCVar11;
  bool bVar12;
  int local_20;
  
  if (this != param_1) {
    uVar1 = *(uint *)(this + 0x188);
    pCVar11 = (CBaseEntity *)0x0;
    if (((uVar1 != 0xffffffff) &&
        (puVar9 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar9 != (undefined *)0xfffffffc)) &&
       (*(uint *)(puVar9 + 8) == uVar1 >> 0xc)) {
      pCVar11 = *(CBaseEntity **)(puVar9 + 4);
    }
    if (((((param_1 != pCVar11) &&
          (((uVar1 = *(uint *)(param_1 + 0x188), uVar1 == 0xffffffff ||
            (puVar9 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar9 == (undefined *)0xfffffffc)) ||
           ((*(uint *)(puVar9 + 8) != uVar1 >> 0xc || (this != *(CBaseEntity **)(puVar9 + 4)))))))
         && (((*(uint *)(this + 0x150) | *(uint *)(param_1 + 0x150)) & 0x400000) == 0)) &&
        ((((*(ushort *)(this + 0x1b4) & 8) == 0 || ((*(ushort *)(param_1 + 0x1b4) & 8) == 0)) ||
         (((this[0x1b6] != (CBaseEntity)0x0 && ((*(ushort *)(this + 0x1b4) & 4) == 0)) ||
          ((param_1[0x1b6] != (CBaseEntity)0x0 && ((*(ushort *)(param_1 + 0x1b4) & 4) == 0))))))))
       && ((((byte)param_1[0x14c] & 1) == 0 && ((*(uint *)(this + 0x14c) & 1) == 0)))) {
      puVar4 = (uint *)GetDataObject(this,1);
      if (puVar4 == (uint *)0x0) {
        puVar4 = (uint *)CreateDataObject(this,1);
        puVar4[3] = (uint)puVar4;
        puVar4[2] = (uint)puVar4;
      }
      else {
        for (puVar5 = (uint *)puVar4[2]; puVar4 != puVar5; puVar5 = (uint *)puVar5[2]) {
          uVar1 = *puVar5;
          if ((((uVar1 != 0xffffffff) &&
               (puVar9 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar9 != (undefined *)0xfffffffc))
              && (*(uint *)(puVar9 + 8) == uVar1 >> 0xc)) &&
             (param_1 == *(CBaseEntity **)(puVar9 + 4))) {
            bVar12 = sm_bDisableTouchFuncs != '\0';
            puVar5[1] = *(uint *)(this + 0xa0);
            if (bVar12) {
              return puVar5;
            }
            PhysicsTouch(this,param_1);
            return puVar5;
          }
        }
      }
      puVar5 = (uint *)CUtlMemoryPool::Alloc((CUtlMemoryPool *)g_EdictTouchLinks,0x14);
      if (puVar5 == (uint *)0x0) {
        DevWarning("AllocTouchLink: failed to allocate touchlink_t.\n");
      }
      else {
        linksallocated = linksallocated + 1;
      }
      uVar3 = g_EdictTouchLinks._20_4_;
      iVar2 = linksallocated;
      if (*(int *)(debug_touchlinks._28_4_ + 0x30) != 0) {
        if (*(int *)(param_1 + 0x30) == 0) {
          iVar10 = 0;
        }
        else {
          iVar10 = *(int *)(param_1 + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
        }
        local_20 = 0;
        if (*(int *)(this + 0x30) != 0) {
          local_20 = *(int *)(this + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
        }
        uVar6 = GetDebugName(param_1);
        uVar7 = GetDebugName(this);
        Msg("add 0x%x: %s-%s (%d-%d) [%d in play, %d max]\n",puVar5,uVar7,uVar6,local_20,iVar10,
            iVar2,uVar3);
      }
      if (puVar5 != (uint *)0x0) {
        puVar5[1] = *(uint *)(this + 0xa0);
        puVar8 = (uint *)(**(code **)(*(int *)param_1 + 0xc))(param_1);
        uVar1 = *puVar8;
        puVar5[4] = 0;
        *puVar5 = uVar1;
        uVar1 = puVar4[2];
        puVar5[3] = (uint)puVar4;
        puVar5[2] = uVar1;
        puVar4[2] = (uint)puVar5;
        *(uint **)(puVar5[2] + 0xc) = puVar5;
        if (((this[0x1b6] == (CBaseEntity)0x0) || ((*(ushort *)(this + 0x1b4) & 0x24) != 0)) &&
           ((*(ushort *)(this + 0x1b4) & 8) == 0)) {
          return puVar5;
        }
        if (((byte)param_1[0x1b4] & 8) != 0) {
          return puVar5;
        }
        puVar5[4] = puVar5[4] | 1;
        if (sm_bDisableTouchFuncs != '\0') {
          return puVar5;
        }
        PhysicsStartTouch(this,param_1);
        return puVar5;
      }
    }
  }
  return (uint *)0x0;
}

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)