L L4D2node

CPhysicsPushedEntities::SetupAllInHierarchy

0x00791690 · 701 bytes · __thiscall

_ZN22CPhysicsPushedEntities19SetupAllInHierarchyEP11CBaseEntity

Decompiled

undefined (2 params)

/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* CPhysicsPushedEntities::SetupAllInHierarchy(CBaseEntity*) */

void __thiscall
CPhysicsPushedEntities::SetupAllInHierarchy(CPhysicsPushedEntities *this,CBaseEntity *param_1)

{
  CBaseEntity CVar1;
  uint uVar2;
  CBaseEntity *pCVar3;
  char cVar4;
  int iVar5;
  undefined *puVar6;
  int iVar7;
  undefined4 local_34;
  undefined4 local_30;
  undefined4 local_28;
  undefined4 local_24;
  int local_20;
  
  if (param_1 != (CBaseEntity *)0x0) {
    local_34 = 0;
    local_30 = 0;
    if (___atan2f_finite == 0) {
      local_20 = 0;
    }
    else {
      (**(code **)(___atan2f_finite + 0x50))
                (___atan2f_finite,&local_34,0,0,0,0,"/data/src/game/server/physics_main.cpp",0x35e,
                 &SetupAllInHierarchy(CBaseEntity*)::tm_fmt,"(%s)%s","Unaccounted",
                 "CPhysicsPushedEntities::SetupAllInHierarchy");
      local_20 = ___atan2f_finite;
    }
    iVar7 = _DAT_0105db00;
    local_28 = local_34;
    local_24 = local_30;
                    /* try { // try from 0079187e to 007918cc has its CatchHandler @ 0079196b */
    if (((_DAT_0105d154 != 0) || (DAT_0105d158 == '\0')) &&
       (iVar5 = ThreadGetCurrentId(), iVar7 == iVar5)) {
      if ((char *)*_DAT_0105d15c != "CPhysicsPushedEntities::SetupAllInHierarchy") {
        _DAT_0105d15c =
             (int *)CVProfNode::GetSubNode((char *)_DAT_0105d15c,0xcb23e0,(char *)0x1,0xbfafa1);
      }
      CVProfNode::EnterScope();
      DAT_0105d158 = '\0';
    }
    uVar2 = *(uint *)(this + 0x10);
    CUtlVector<CPhysicsPushedEntities::PhysicsPusherInfo_t,CUtlMemory<CPhysicsPushedEntities::PhysicsPusherInfo_t,int>>
    ::GrowVector((CUtlVector<CPhysicsPushedEntities::PhysicsPusherInfo_t,CUtlMemory<CPhysicsPushedEntities::PhysicsPusherInfo_t,int>>
                  *)(this + 4),1);
    if ((int)(~uVar2 + *(int *)(this + 0x10)) < 1) {
      *(CBaseEntity **)(*(int *)(this + 4) + uVar2 * 0x10) = param_1;
      CVar1 = param_1[0x14d];
    }
    else {
      iVar7 = uVar2 * 0x10;
      _V_memmove((void *)(*(int *)(this + 4) + 0x10 + iVar7),(void *)(*(int *)(this + 4) + iVar7),
                 (~uVar2 + *(int *)(this + 0x10)) * 0x10);
      *(CBaseEntity **)(*(int *)(this + 4) + iVar7) = param_1;
      CVar1 = param_1[0x14d];
    }
    iVar7 = uVar2 * 0x10;
    if (((byte)CVar1 & 8) != 0) {
      iVar7 = uVar2 << 4;
      CBaseEntity::CalcAbsolutePosition(param_1);
    }
    puVar6 = g_pEntityList;
    iVar7 = iVar7 + *(int *)(this + 4);
    *(undefined4 *)(iVar7 + 4) = *(undefined4 *)(param_1 + 0x2e0);
    *(undefined4 *)(iVar7 + 8) = *(undefined4 *)(param_1 + 0x2e4);
    *(undefined4 *)(iVar7 + 0xc) = *(undefined4 *)(param_1 + 0x2e8);
    uVar2 = *(uint *)(param_1 + 0x18c);
    iVar7 = _DAT_0105db00;
    while (((_DAT_0105db00 = iVar7, uVar2 != 0xffffffff &&
            (puVar6 = puVar6 + (uVar2 & 0xfff) * 0x10, puVar6 != (undefined *)0xfffffffc)) &&
           ((*(uint *)(puVar6 + 8) == uVar2 >> 0xc &&
            (pCVar3 = *(CBaseEntity **)(puVar6 + 4), pCVar3 != (CBaseEntity *)0x0))))) {
                    /* try { // try from 007918f2 to 00791952 has its CatchHandler @ 00791980 */
      SetupAllInHierarchy(this,pCVar3);
      uVar2 = *(uint *)(pCVar3 + 400);
      puVar6 = g_pEntityList;
      iVar7 = _DAT_0105db00;
    }
    if (((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) &&
       (iVar5 = ThreadGetCurrentId(), iVar7 == iVar5)) {
      cVar4 = CVProfNode::ExitScope();
      if (cVar4 != '\0') {
        _DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
      }
      DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
    }
    if (local_20 != 0) {
      (**(code **)(local_20 + 0x54))(local_20,local_28,local_24,0,0,0);
    }
  }
  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)