L L4D2node

PhysModelCreateCustom

0x00492e30 · 350 bytes · __cdecl

_Z21PhysModelCreateCustomP11CBaseEntityPK12CPhysCollideRK6VectorRK6QAnglePKcbP7solid_t

Decompiled

undefined (7 params)

/* PhysModelCreateCustom(CBaseEntity*, CPhysCollide const*, Vector const&, QAngle const&, char
   const*, bool, solid_t*) */

int PhysModelCreateCustom
              (CBaseEntity *param_1,CPhysCollide *param_2,Vector *param_3,QAngle *param_4,
              char *param_5,bool param_6,solid_t *param_7)

{
  undefined4 uVar1;
  int iVar2;
  int *piVar3;
  int iVar4;
  int in_GS_OFFSET;
  solid_t local_660 [1600];
  int local_20;
  
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  if (param_7 == (solid_t *)0x0) {
    param_7 = local_660;
    PhysGetDefaultAABBSolid(param_7);
  }
  uVar1 = (**(code **)(*physprops + 0x10))(physprops,param_7 + 0x400);
  *(CBaseEntity **)(param_7 + 0x630) = param_1;
  *(char **)(param_7 + 0x62c) = param_5;
  if (physenv == (int *)0x0) {
    piVar3 = (int *)(**(code **)(*g_pPhys2World + 0xa4))
                              (g_pPhys2World,param_2,param_3,param_4,param_6,param_7 + 0x614);
    iVar4 = 0;
    if (piVar3 != (int *)0x0) {
      iVar4 = (**(code **)(*piVar3 + 0x60))(piVar3);
    }
  }
  else {
    if (param_6) {
      iVar2 = (**(code **)(*physenv + 0x24))(physenv,param_2,uVar1,param_3,param_4,param_7 + 0x614);
    }
    else {
      iVar2 = (**(code **)(*physenv + 0x20))();
    }
    iVar4 = 0;
    if (iVar2 != 0) {
      (**(code **)(*g_pPhysSaveRestoreManager + 8))(g_pPhysSaveRestoreManager,iVar2,param_2);
      iVar4 = iVar2;
    }
  }
  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
    return iVar4;
  }
                    /* WARNING: Subroutine does not return */
  __stack_chk_fail();
}

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)