L L4D2node

UTIL_ItemCanBeTouchedByPlayer

0x006e4490 · 1246 bytes · __cdecl

_Z29UTIL_ItemCanBeTouchedByPlayerP11CBaseEntityP11CBasePlayer

Decompiled

undefined (2 params)

/* WARNING: Removing unreachable block (ram,0x006e46f4) */
/* WARNING: Removing unreachable block (ram,0x006e46ac) */
/* WARNING: Removing unreachable block (ram,0x006e4969) */
/* WARNING: Removing unreachable block (ram,0x006e4961) */
/* UTIL_ItemCanBeTouchedByPlayer(CBaseEntity*, CBasePlayer*) */

char UTIL_ItemCanBeTouchedByPlayer(CBaseEntity *param_1,CBasePlayer *param_2)

{
  CBaseEntity *pCVar1;
  int *piVar2;
  char cVar3;
  int iVar4;
  float *pfVar5;
  matrix3x4_t *pmVar6;
  int iVar7;
  float local_f8;
  float local_f4;
  float local_f0;
  float local_ec;
  float local_e8;
  float local_e4;
  CTraceFilterSkipTwoEntities local_e0 [20];
  float local_cc;
  float local_c8;
  float local_c4;
  float local_bc;
  float local_b8;
  float local_b4;
  undefined4 local_ac;
  undefined4 local_a8;
  undefined4 local_a4;
  undefined4 local_9c;
  undefined4 local_98;
  undefined4 local_94;
  undefined4 local_8c;
  undefined1 local_88;
  undefined1 local_87;
  Vector local_70 [12];
  Vector local_64 [32];
  float local_44;
  
  if ((param_1 == (CBaseEntity *)0x0) || (param_2 == (CBasePlayer *)0x0)) {
    cVar3 = '\0';
  }
  else {
    cVar3 = (**(code **)(*(int *)param_2 + 0x4fc))(param_2);
    if (cVar3 == '\0') {
      piVar2 = *(int **)(param_1 + 0x238);
      if (piVar2 == (int *)0x0) {
        pCVar1 = param_1 + 0x194;
        if ((AllocTempVector()::s_vecTemp == '\0') &&
           (iVar4 = __cxa_guard_acquire(&AllocTempVector()::s_vecTemp), iVar4 != 0)) {
          __cxa_guard_release(&AllocTempVector()::s_vecTemp);
        }
        if ((AllocTempVector()::s_nIndex == '\0') &&
           (iVar4 = __cxa_guard_acquire(&AllocTempVector()::s_nIndex), iVar4 != 0)) {
          AllocTempVector()::s_nIndex = 0;
          __cxa_guard_release(&AllocTempVector()::s_nIndex);
        }
        AllocTempVector()::s_nIndex = AllocTempVector()::s_nIndex + 0x10001 & 0x7f;
        LOCK();
        UNLOCK();
        iVar4 = AllocTempVector()::s_nIndex * 0xc;
        if ((AllocTempVector()::s_vecTemp == '\0') &&
           (iVar7 = __cxa_guard_acquire(&AllocTempVector()::s_vecTemp), iVar7 != 0)) {
          __cxa_guard_release(&AllocTempVector()::s_vecTemp);
        }
        if ((AllocTempVector()::s_nIndex == '\0') &&
           (iVar7 = __cxa_guard_acquire(&AllocTempVector()::s_nIndex), iVar7 != 0)) {
          AllocTempVector()::s_nIndex = 0;
          __cxa_guard_release(&AllocTempVector()::s_nIndex);
        }
        AllocTempVector()::s_nIndex = AllocTempVector()::s_nIndex + 0x10001 & 0x7f;
        LOCK();
        UNLOCK();
        iVar7 = AllocTempVector()::s_nIndex * 0xc;
        *(float *)(AllocTempVector()::s_vecTemp + iVar7) =
             (*(float *)(param_1 + 0x1a8) - *(float *)(param_1 + 0x19c)) * 0.5 +
             *(float *)(param_1 + 0x19c);
        *(float *)(AllocTempVector()::s_vecTemp + iVar7 + 4) =
             (*(float *)(param_1 + 0x1ac) - *(float *)(param_1 + 0x1a0)) * 0.5 +
             *(float *)(param_1 + 0x1a0);
        *(float *)(AllocTempVector()::s_vecTemp + iVar7 + 8) =
             (*(float *)(param_1 + 0x1b0) - *(float *)(param_1 + 0x1a4)) * 0.5 +
             *(float *)(param_1 + 0x1a4);
        if (((((byte)param_1[0x1b4] & 0x40) == 0) && (((byte)param_1[0x1b6] & 0xfd) != 0)) &&
           ((pfVar5 = (float *)(**(code **)(*(int *)(param_1 + 0x194) + 0x24))(pCVar1),
            vec3_angle != *pfVar5 || ((DAT_01053d40 != pfVar5[1] || (DAT_01053d44 != pfVar5[2]))))))
        {
          pmVar6 = (matrix3x4_t *)(**(code **)(*(int *)(param_1 + 0x194) + 0x28))(pCVar1);
          VectorTransform((float *)(AllocTempVector()::s_vecTemp + iVar7),pmVar6,
                          (float *)(AllocTempVector()::s_vecTemp + iVar4));
          local_f4 = *(float *)(AllocTempVector()::s_vecTemp + iVar4 + 4);
          local_f0 = *(float *)(AllocTempVector()::s_vecTemp + iVar4 + 8);
          local_f8 = *(float *)(AllocTempVector()::s_vecTemp + iVar4);
        }
        else {
          pfVar5 = (float *)(**(code **)(*(int *)(param_1 + 0x194) + 0x20))(pCVar1);
          local_f8 = *pfVar5 + *(float *)(AllocTempVector()::s_vecTemp + iVar7);
          *(float *)(AllocTempVector()::s_vecTemp + iVar4) = local_f8;
          local_f4 = pfVar5[1] + *(float *)(AllocTempVector()::s_vecTemp + iVar7 + 4);
          *(float *)(AllocTempVector()::s_vecTemp + iVar4 + 4) = local_f4;
          local_f0 = pfVar5[2] + *(float *)(AllocTempVector()::s_vecTemp + iVar7 + 8);
          *(float *)(AllocTempVector()::s_vecTemp + iVar4 + 8) = local_f0;
        }
      }
      else {
        (**(code **)(*piVar2 + 0xc4))(piVar2,&local_f8,local_70);
      }
      (**(code **)(*(int *)param_2 + 0x234))(&local_ec,param_2);
      CTraceFilterSkipTwoEntities::CTraceFilterSkipTwoEntities
                (local_e0,(IHandleEntity *)param_2,(IHandleEntity *)param_1,8);
      local_8c = 0;
      local_88 = 1;
      local_cc = local_f8;
      local_c4 = local_f0;
      local_bc = local_ec - local_f8;
      local_b4 = local_e4 - local_f0;
      local_c8 = local_f4;
      local_b8 = local_e8 - local_f4;
      local_94 = 0;
      local_98 = 0;
      local_9c = 0;
      local_87 = local_b4 * local_b4 + local_bc * local_bc + local_b8 * local_b8 != 0.0;
      local_a4 = 0;
      local_a8 = 0;
      local_ac = 0;
      (**(code **)(*enginetrace + 0x14))(enginetrace,&local_cc,0x200400b,local_e0,local_70);
      if (*(int *)(r_visualizetraces._28_4_ + 0x30) != 0) {
        DebugDrawLine(local_70,local_64,0xff,0,0,true,-1.0);
      }
      return 1.0 <= local_44;
    }
  }
  return cVar3;
}

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)