L L4D2node

CBaseEntity::PhysicsRemoveToucher

0x004756b0 · 527 bytes · __cdecl

_ZN11CBaseEntity20PhysicsRemoveToucherEPS_P11touchlink_t

Decompiled

undefined (2 params)

/* CBaseEntity::PhysicsRemoveToucher(CBaseEntity*, touchlink_t*) */

void CBaseEntity::PhysicsRemoveToucher(CBaseEntity *param_1,touchlink_t *param_2)

{
  uint uVar1;
  int iVar2;
  undefined4 uVar3;
  undefined4 uVar4;
  undefined4 uVar5;
  int iVar6;
  CBaseEntity *this;
  undefined *puVar7;
  int local_28;
  int local_24;
  int local_20;
  
  local_20 = 0;
  if ((((((byte)param_2[0x10] & 1) != 0) && (uVar1 = *(uint *)param_2, uVar1 != 0xffffffff)) &&
      (puVar7 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar7 != (undefined *)0xfffffffc)) &&
     (((*(uint *)(puVar7 + 8) == uVar1 >> 0xc &&
       (iVar2 = *(int *)(puVar7 + 4), local_20 = iVar2, iVar2 != 0)) &&
      (local_20 = 0, param_1 != (CBaseEntity *)0x0)))) {
    local_20 = iVar2;
  }
  *(undefined4 *)(*(int *)(param_2 + 8) + 0xc) = *(undefined4 *)(param_2 + 0xc);
  *(undefined4 *)(*(int *)(param_2 + 0xc) + 8) = *(undefined4 *)(param_2 + 8);
  uVar3 = g_EdictTouchLinks._20_4_;
  iVar2 = linksallocated;
  if (*(int *)(debug_touchlinks._28_4_ + 0x30) != 0) {
    if (*(int *)(param_1 + 0x30) == 0) {
      local_24 = 0;
    }
    else {
      local_24 = *(int *)(param_1 + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
    }
    iVar6 = 0;
    uVar1 = *(uint *)param_2;
    if (((uVar1 != 0xffffffff) &&
        (puVar7 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar7 != (undefined *)0xfffffffc)) &&
       (*(uint *)(puVar7 + 8) == uVar1 >> 0xc)) {
      iVar6 = *(int *)(puVar7 + 4);
    }
    if (*(int *)(iVar6 + 0x30) == 0) {
      local_28 = 0;
    }
    else {
      local_28 = *(int *)(iVar6 + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
    }
    uVar4 = GetDebugName(param_1);
    this = (CBaseEntity *)0x0;
    uVar1 = *(uint *)param_2;
    if (((uVar1 != 0xffffffff) &&
        (puVar7 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar7 != (undefined *)0xfffffffc)) &&
       (*(uint *)(puVar7 + 8) == uVar1 >> 0xc)) {
      this = *(CBaseEntity **)(puVar7 + 4);
    }
    uVar5 = GetDebugName(this);
    Msg("remove 0x%x: %s-%s (%d-%d) [%d in play, %d max]\n",param_2,uVar5,uVar4,local_28,local_24,
        iVar2,uVar3);
  }
  if (param_2 == g_pNextLink) {
    g_pNextLink = *(touchlink_t **)(param_2 + 8);
  }
  linksallocated = linksallocated + -1;
  *(undefined4 *)(param_2 + 8) = 0;
  *(undefined4 *)(param_2 + 0xc) = 0;
  CUtlMemoryPool::Free((CUtlMemoryPool *)g_EdictTouchLinks,param_2);
  if (local_20 == 0) {
    return;
  }
                    /* WARNING: Could not recover jumptable at 0x0047585f. Too many branches */
                    /* WARNING: Treating indirect jump as call */
  (**(code **)(*(int *)param_1 + 0x1b8))();
  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)