L L4D2node

CM_Physics2VCollideForModel

0x001196b0 · 215 bytes · __cdecl

_Z27CM_Physics2VCollideForModeliPK7model_t

Decompiled

undefined (2 params)

/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* CM_Physics2VCollideForModel(int, model_t const*) */

int CM_Physics2VCollideForModel(int param_1,model_t *param_2)

{
  uint uVar1;
  int iVar2;
  undefined4 unaff_ESI;
  
  if (param_2 != (model_t *)0x0) {
    if (*(int *)(param_2 + 0x110) == 1) {
      uVar1 = param_1 - 2;
      if (uVar1 < DAT_00394570) {
        if (((int)uVar1 < 0) || (DAT_00394578 <= (int)uVar1)) {
          Error("Cannot load corrupted map.\n");
        }
        return uVar1 * 0x44 + _DAT_00394574;
      }
    }
    else if (*(int *)(param_2 + 0x110) == 3) {
      if (g_pPhysics2ResourceManager != (int *)0x0) {
        unaff_ESI = (**(code **)(*g_pPhysics2ResourceManager + 0x58))(g_pPhysics2ResourceManager);
        (**(code **)(*g_pPhysics2ResourceManager + 0x54))(g_pPhysics2ResourceManager,param_2 + 4);
      }
                    /* try { // try from 0011971c to 0011971e has its CatchHandler @ 00119794 */
      iVar2 = (**(code **)(*g_pMDLCache + 0x34))(g_pMDLCache,*(undefined2 *)(param_2 + 0x134),1);
      if (g_pPhysics2ResourceManager != (int *)0x0) {
        (**(code **)(*g_pPhysics2ResourceManager + 0x54))(g_pPhysics2ResourceManager,unaff_ESI);
      }
      return iVar2;
    }
  }
  return 0;
}

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)