L L4D2node

CBaseEntity::VPhysicsInitStatic

0x00410150 · 606 bytes · __thiscall

_ZN11CBaseEntity18VPhysicsInitStaticEv

Decompiled

undefined (1 param)

/* CBaseEntity::VPhysicsInitStatic() */

IPhysicsObject * __thiscall CBaseEntity::VPhysicsInitStatic(CBaseEntity *this)

{
  CBaseEntity *pCVar1;
  uint uVar2;
  char cVar3;
  int iVar4;
  Vector *pVVar5;
  Vector *pVVar6;
  IPhysicsObject *pIVar7;
  undefined *puVar8;
  
  cVar3 = VPhysicsInitSetup(this);
  if (cVar3 != '\0') {
    uVar2 = *(uint *)(this + 0x188);
    if ((((uVar2 != 0xffffffff) &&
         (puVar8 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar8 != (undefined *)0xfffffffc)) &&
        (*(uint *)(puVar8 + 8) == uVar2 >> 0xc)) && (*(int *)(puVar8 + 4) != 0)) {
      iVar4 = (**(code **)(*(int *)(this + 0x194) + 0x2c))((CCollisionProperty *)(this + 0x194));
      if (iVar4 == 1) {
        iVar4 = GetRootMoveParent(this);
        iVar4 = (**(code **)(*(int *)(iVar4 + 0x194) + 0x2c))(iVar4 + 0x194);
        if (iVar4 != 1) {
          CCollisionProperty::SetSolid((CCollisionProperty *)(this + 0x194),6);
        }
      }
      pIVar7 = (IPhysicsObject *)VPhysicsInitShadow(this,false,false,(solid_t *)0x0);
      return pIVar7;
    }
    pCVar1 = this + 0x194;
    iVar4 = (**(code **)(*(int *)(this + 0x194) + 0x2c))(pCVar1);
    if (iVar4 != 0) {
      iVar4 = (**(code **)(*(int *)(this + 0x194) + 0x2c))(pCVar1);
      if (iVar4 == 2) {
        if (((byte)this[0x14d] & 8) != 0) {
          CalcAbsolutePosition(this);
        }
        pVVar5 = (Vector *)(**(code **)(*(int *)(this + 0x194) + 8))(pCVar1);
        pVVar6 = (Vector *)(**(code **)(*(int *)(this + 0x194) + 4))(pCVar1);
        pIVar7 = (IPhysicsObject *)
                 PhysModelCreateBox(this,pVVar6,pVVar5,(Vector *)(this + 0x2e0),true);
      }
      else {
        iVar4 = (**(code **)(*(int *)(this + 0x194) + 0x2c))(pCVar1);
        if (iVar4 == 3) {
          if (((byte)this[0x14d] & 8) != 0) {
            CalcAbsolutePosition(this);
            if (((byte)this[0x14d] & 8) != 0) {
              CalcAbsolutePosition(this);
            }
          }
          pVVar5 = (Vector *)(**(code **)(*(int *)(this + 0x194) + 8))(pCVar1);
          pVVar6 = (Vector *)(**(code **)(*(int *)(this + 0x194) + 4))(pCVar1);
          pIVar7 = (IPhysicsObject *)
                   PhysModelCreateOBB(this,pVVar6,pVVar5,(Vector *)(this + 0x2e0),
                                      (QAngle *)(this + 0x37c),true);
        }
        else {
          if (((byte)this[0x14d] & 8) != 0) {
            CalcAbsolutePosition(this);
            if (((byte)this[0x14d] & 8) != 0) {
              CalcAbsolutePosition(this);
            }
          }
          iVar4 = (**(code **)(*(int *)this + 0x1c))(this);
          pIVar7 = (IPhysicsObject *)
                   PhysModelCreateUnmoveable
                             (this,iVar4,(Vector *)(this + 0x2e0),(QAngle *)(this + 0x37c));
        }
      }
      VPhysicsSetObject(this,pIVar7);
      return pIVar7;
    }
  }
  return (IPhysicsObject *)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)