L L4D2node

PhysCreateVirtualTerrain

0x004932c0 · 421 bytes · __cdecl

_Z24PhysCreateVirtualTerrainP11CBaseEntityRK14objectparams_t

Decompiled

undefined (2 params)

/* PhysCreateVirtualTerrain(CBaseEntity*, objectparams_t const&) */

void PhysCreateVirtualTerrain(CBaseEntity *param_1,objectparams_t *param_2)

{
  code *pcVar1;
  ushort uVar2;
  int iVar3;
  undefined4 uVar4;
  int *piVar5;
  int iVar6;
  int in_GS_OFFSET;
  PhysicsCollisionRulesCache_t local_a6c [12];
  char local_a60 [2580];
  undefined4 local_4c;
  undefined4 local_48;
  undefined4 local_44;
  undefined4 local_40;
  undefined4 local_3c;
  undefined4 local_38;
  char *local_34;
  CBaseEntity *local_30;
  undefined4 local_2c;
  undefined4 local_28;
  undefined1 local_24;
  undefined3 uStack_23;
  int local_20;
  
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  iVar6 = 0;
  do {
    iVar3 = (**(code **)(*modelinfo + 0xa0))(modelinfo,iVar6);
    if (iVar3 != 0) {
      local_4c = *(undefined4 *)param_2;
      local_48 = *(undefined4 *)(param_2 + 4);
      local_44 = *(undefined4 *)(param_2 + 8);
      local_40 = *(undefined4 *)(param_2 + 0xc);
      local_3c = *(undefined4 *)(param_2 + 0x10);
      local_38 = *(undefined4 *)(param_2 + 0x14);
      local_34 = *(char **)(param_2 + 0x18);
      local_2c = *(undefined4 *)(param_2 + 0x20);
      local_28 = *(undefined4 *)(param_2 + 0x24);
      _local_24 = CONCAT31((int3)((uint)*(undefined4 *)(param_2 + 0x28) >> 8),1);
      local_30 = param_1;
      V_snprintf(local_a60,0x400,"vdisp_%04d",iVar6);
      local_34 = local_a60;
      uVar4 = (**(code **)(*physprops + 0x10))(physprops,"default");
      piVar5 = (int *)(**(code **)(*physenv + 0x24))
                                (physenv,iVar3,uVar4,&vec3_origin,&vec3_angle,&local_4c);
      if (piVar5 != (int *)0x0) {
        CBaseEntity::GetPhysicsCollisionRulesCache(param_1,local_a6c);
        (**(code **)(*piVar5 + 0x160))(piVar5,local_a6c,0);
      }
      pcVar1 = *(code **)(*piVar5 + 0x5c);
      uVar2 = (**(code **)(*piVar5 + 0x60))(piVar5);
      (*pcVar1)(piVar5,uVar2 | 0x200);
      (**(code **)(*piVar5 + 0x154))(piVar5,2);
    }
    iVar6 = iVar6 + 1;
  } while (iVar6 != 0x800);
  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
    return;
  }
                    /* 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)