L L4D2node

CBaseEntity::InvalidatePhysicsRecursive

0x0040e8c0 · 415 bytes · __thiscall

_ZN11CBaseEntity26InvalidatePhysicsRecursiveEi

Decompiled

undefined (2 params)

/* CBaseEntity::InvalidatePhysicsRecursive(int) */

void __thiscall CBaseEntity::InvalidatePhysicsRecursive(CBaseEntity *this,int param_1)

{
  uint *puVar1;
  CBaseEntity *this_00;
  uint uVar2;
  undefined *puVar3;
  undefined *puVar4;
  uint uVar5;
  uint uVar6;
  bool bVar7;
  
  uVar5 = (param_1 & 4U) << 10;
  if ((param_1 & 1U) != 0) {
    puVar1 = *(uint **)(this + 0x30);
    uVar5 = (uint)(byte)((byte)(uVar5 >> 8) | 8) << 8;
    if (puVar1 != (uint *)0x0) {
      *puVar1 = *puVar1 | 0x80;
      if ((*(int *)(this + 0x30) != 0) &&
         (*(int *)(this + 0x30) - *(int *)(gpGlobals + 0x58) >> 4 != 0)) {
        CCollisionProperty::MarkPartitionHandleDirty((CCollisionProperty *)(this + 0x194));
      }
    }
  }
  uVar6 = param_1;
  if ((param_1 & 2U) != 0) {
    uVar5 = uVar5 | 0x800;
    if ((((*(ushort *)(this + 0x1b4) & 0x100) != 0) || (7 < (byte)this[0x1be])) ||
       ((uVar6 = 1 << ((byte)this[0x1be] & 0x1f), (uVar6 & 0xa8) == 0 &&
        (((uVar6 & 0x43) == 0 ||
         (((*(ushort *)(this + 0x1b4) & 0x40) == 0 && (((byte)this[0x1b6] & 0xfd) != 0)))))))) {
      CCollisionProperty::MarkSurroundingBoundsDirty((CCollisionProperty *)(this + 0x194));
      uVar6 = param_1 | 5;
      if ((param_1 & 0x20U) != 0) {
        uVar6 = param_1 & 0xffffffdfU | 5;
      }
      goto LAB_0040e920;
    }
    uVar6 = param_1 | 5;
  }
  if ((param_1 & 0x20U) != 0) {
    if (this[0x1be] == (CBaseEntity)0x7) {
      CCollisionProperty::MarkSurroundingBoundsDirty((CCollisionProperty *)(this + 0x194));
    }
    uVar6 = uVar6 & 0xffffffdf;
  }
LAB_0040e920:
  *(uint *)(this + 0x14c) = *(uint *)(this + 0x14c) | uVar5;
  bVar7 = (uVar6 & 0x18) == 0;
  uVar5 = uVar6;
  if (!bVar7) {
    uVar5 = 7;
  }
  uVar2 = *(uint *)(this + 0x18c);
  puVar3 = g_pEntityList;
  if (uVar2 != 0xffffffff) {
    while (((puVar4 = puVar3 + (uVar2 & 0xfff) * 0x10, puVar4 != (undefined *)0xfffffffc &&
            (*(uint *)(puVar4 + 8) == uVar2 >> 0xc)) &&
           (this_00 = *(CBaseEntity **)(puVar4 + 4), this_00 != (CBaseEntity *)0x0))) {
      if ((bVar7 || (uVar6 & 7) != 0) || (this_00[0x185] != (CBaseEntity)0x0)) {
        InvalidatePhysicsRecursive(this_00,uVar5);
        puVar3 = g_pEntityList;
      }
      uVar2 = *(uint *)(this_00 + 400);
      if (uVar2 == 0xffffffff) {
        return;
      }
    }
  }
  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)