L L4D2node

Physics2ModelCreate

0x00492430 · 522 bytes · __cdecl

_Z19Physics2ModelCreateP11CBaseEntityiRK6VectorRK6QAnglej

Decompiled

undefined (5 params)

/* Physics2ModelCreate(CBaseEntity*, int, Vector const&, QAngle const&, unsigned int) */

int * Physics2ModelCreate(CBaseEntity *param_1,int param_2,Vector *param_3,QAngle *param_4,
                         uint param_5)

{
  code *pcVar1;
  int iVar2;
  undefined4 uVar3;
  int *piVar4;
  undefined1 *puVar5;
  undefined4 local_20;
  
  if (g_pPhysics2 != (int *)0x0) {
    (**(code **)(*g_pPhysics2 + 0x44))
              (g_pPhysics2,"/data/src/game/server/../../game/shared/physics_shared.cpp",0x15e);
  }
                    /* try { // try from 0049246b to 004924c1 has its CatchHandler @ 0049267c */
  iVar2 = (**(code **)(*modelinfo + 0x1c))(modelinfo,param_2);
  if (iVar2 == 0) {
    piVar4 = (int *)0x0;
  }
  else {
    pcVar1 = *(code **)(*modelinfo + 0x10);
    uVar3 = (**(code **)(*modelinfo + 8))(modelinfo,param_2);
    uVar3 = (*pcVar1)(modelinfo,uVar3);
    if (g_pPhysics2ResourceManager != (int *)0x0) {
      local_20 = (**(code **)(*g_pPhysics2ResourceManager + 0x58))(g_pPhysics2ResourceManager);
      (**(code **)(*g_pPhysics2ResourceManager + 0x54))(g_pPhysics2ResourceManager,uVar3);
    }
                    /* try { // try from 004924ed to 0049254e has its CatchHandler @ 00492647 */
    piVar4 = (int *)(**(code **)(*g_pPhys2World + 0xa8))
                              (g_pPhys2World,iVar2,param_3,param_4,param_5,0);
    if (piVar4 == (int *)0x0) {
      pcVar1 = *(code **)(*modelinfo + 0x10);
      uVar3 = (**(code **)(*modelinfo + 8))(modelinfo,param_2);
      uVar3 = (*pcVar1)(modelinfo,uVar3);
      puVar5 = &DAT_00d539c2;
      if (*(undefined1 **)(param_1 + 0x7c) != (undefined1 *)0x0) {
        puVar5 = *(undefined1 **)(param_1 + 0x7c);
      }
      Warning(" Could not create actor %s: %s\n",puVar5,uVar3);
      piVar4 = (int *)0x0;
    }
    else {
      (**(code **)(*piVar4 + 0x8c))(piVar4,*(undefined2 *)(iVar2 + 6));
      (**(code **)(*piVar4 + 0xc))(piVar4,param_1);
      if (*(int *)(phys2_debug_dump_entities._28_4_ + 0x30) != 0) {
        pcVar1 = *(code **)(*modelinfo + 0x10);
                    /* try { // try from 0049259a to 00492636 has its CatchHandler @ 00492647 */
        uVar3 = (**(code **)(*modelinfo + 8))(modelinfo,param_2);
        uVar3 = (*pcVar1)(modelinfo,uVar3);
        puVar5 = &DAT_00d539c2;
        if (*(undefined1 **)(param_1 + 0x7c) != (undefined1 *)0x0) {
          puVar5 = *(undefined1 **)(param_1 + 0x7c);
        }
        (**(code **)(*piVar4 + 0x3c))(piVar4,"%s:%s %s @%p",puVar5,uVar3,&DAT_00d539c2,param_1);
      }
      pcVar1 = *(code **)(*g_pPhysSaveRestoreManager + 4);
      uVar3 = (**(code **)(*piVar4 + 0x60))(piVar4);
      (*pcVar1)(g_pPhysSaveRestoreManager,uVar3,param_2);
    }
    if (g_pPhysics2ResourceManager != (int *)0x0) {
      (**(code **)(*g_pPhysics2ResourceManager + 0x54))(g_pPhysics2ResourceManager,local_20);
    }
  }
  if (g_pPhysics2 != (int *)0x0) {
    (**(code **)(*g_pPhysics2 + 0x48))(g_pPhysics2);
  }
  return piVar4;
}

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)