L L4D2node

PhysDestroyObject

0x00492fa0 · 174 bytes · __cdecl

_Z17PhysDestroyObjectP14IPhysicsObjectP11CBaseEntity

Decompiled

undefined (2 params)

/* PhysDestroyObject(IPhysicsObject*, CBaseEntity*) */

void PhysDestroyObject(IPhysicsObject *param_1,CBaseEntity *param_2)

{
  int iVar1;
  
  (**(code **)(*g_pPhysSaveRestoreManager + 0xc))(g_pPhysSaveRestoreManager,param_1);
  if (param_1 != (IPhysicsObject *)0x0) {
    (**(code **)(*(int *)param_1 + 0x44))(param_1,0);
  }
  if (((g_EntityCollisionHash != (int *)0x0) &&
      ((**(code **)(*g_EntityCollisionHash + 0x14))(g_EntityCollisionHash,param_1),
      param_2 != (CBaseEntity *)0x0)) && (((byte)param_2[0x14c] & 1) != 0)) {
    (**(code **)(*g_EntityCollisionHash + 0x14))(g_EntityCollisionHash,param_2);
  }
  if ((param_1 != (IPhysicsObject *)0x0) &&
     (iVar1 = (**(code **)(*(int *)param_1 + 0x15c))(param_1), iVar1 != 0)) {
                    /* WARNING: Could not recover jumptable at 0x0049301f. Too many branches */
                    /* WARNING: Treating indirect jump as call */
    (**(code **)(*g_pPhys2World + 8))();
    return;
  }
                    /* WARNING: Could not recover jumptable at 0x00493053. Too many branches */
                    /* WARNING: Treating indirect jump as call */
  (**(code **)(*physenv + 0x2c))();
  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)