L L4D2node

CDispInfo::SpecifyWalkableDynamicMesh

0x00133160 · 1469 bytes · __thiscall

_ZN9CDispInfo26SpecifyWalkableDynamicMeshEv

Decompiled

undefined (1 param)

/* CDispInfo::SpecifyWalkableDynamicMesh() */

void __thiscall CDispInfo::SpecifyWalkableDynamicMesh(CDispInfo *this)

{
  ushort *puVar1;
  int iVar2;
  undefined4 uVar3;
  char cVar4;
  int *piVar5;
  int *piVar6;
  int iVar7;
  int iVar8;
  undefined4 *puVar9;
  undefined4 *puVar10;
  int iVar11;
  int *piVar12;
  int *piVar13;
  byte bVar14;
  int local_204 [39];
  int local_168;
  int local_164;
  int local_160;
  int local_154;
  int *local_150;
  undefined4 local_14c;
  char local_148;
  int local_144;
  int local_138;
  int *local_134;
  int local_130;
  int local_12c;
  int local_128;
  int local_124;
  undefined4 local_120;
  undefined4 local_11c;
  undefined4 local_118;
  undefined1 local_114;
  int local_110 [3];
  int local_104;
  int local_100;
  int local_f8;
  int local_f4;
  int local_f0;
  int local_ec;
  int local_e8;
  int local_e4;
  int local_e0;
  int local_dc;
  undefined4 local_c4;
  uint local_c0;
  undefined4 *local_bc;
  int local_b0;
  int local_ac;
  undefined4 local_a4 [8];
  undefined4 local_84 [6];
  int *local_6c;
  undefined1 local_68;
  undefined4 local_64;
  int local_60;
  int local_5c;
  undefined4 *local_58;
  int local_54;
  int local_50;
  int local_4c [8];
  undefined4 local_2c;
  int local_28;
  int local_24;
  
  bVar14 = 0;
  piVar5 = (int *)(**(code **)(*materials + 0x180))(materials);
  if (piVar5 != (int *)0x0) {
                    /* try { // try from 0013318e to 00133190 has its CatchHandler @ 00133760 */
    (**(code **)(*piVar5 + 8))(piVar5);
  }
                    /* try { // try from 001331bc to 001331c1 has its CatchHandler @ 0013375c */
  piVar6 = (int *)(**(code **)(*piVar5 + 0xe8))(piVar5,0,0,0,0);
  local_148 = '\0';
  iVar2 = *(int *)(this + 0x23c);
  local_134 = (int *)0x0;
  local_130 = 0;
  local_12c = 0;
  local_124 = 0;
  local_120 = 0;
  local_11c = 0xffffffff;
  local_118 = 0;
  local_6c = (int *)0x0;
  local_28 = -1;
  local_24 = 0;
  local_60 = 0;
  local_5c = 0;
  local_64 = 0;
  local_2c = 0;
  local_c4 = 0xffffffff;
  uVar3 = *(undefined4 *)(*(int *)(this + 0x1dc) + 0x30);
  local_14c = 2;
                    /* try { // try from 00133294 to 00133555 has its CatchHandler @ 00133728 */
  local_150 = piVar6;
  (**(code **)(*piVar6 + 0x30))(piVar6,2);
  (**(code **)(*local_150 + 0x4c))(local_150,uVar3,iVar2,local_204);
  local_130 = iVar2;
  local_6c = piVar6;
  piVar12 = local_204;
  piVar13 = local_110;
  for (iVar7 = 0x29; iVar7 != 0; iVar7 = iVar7 + -1) {
    *piVar13 = *piVar12;
    piVar12 = piVar12 + (uint)bVar14 * -2 + 1;
    piVar13 = piVar13 + (uint)bVar14 * -2 + 1;
  }
  local_134 = piVar6 + 1;
  local_114 = 0;
  local_12c = 0;
  local_128 = local_168;
  iVar7 = local_128;
  local_144 = local_160;
  local_124 = 0;
  local_64 = uVar3;
  local_60 = 0;
  local_138 = local_154;
  local_68 = 0;
  local_c0 = ~-(uint)(local_c0 == 0) & 2;
  if (local_28 == -1) {
    local_2c = 0;
    local_24 = local_168;
    local_28 = local_164;
  }
  local_5c = 0;
  local_54 = local_b0;
  local_58 = local_bc;
  puVar10 = local_a4;
  do {
    puVar9 = puVar10 + 1;
    puVar10[0x16] = *puVar10;
    puVar10 = puVar9;
  } while (puVar9 != local_84);
  iVar8 = 0;
  local_50 = local_ac;
  iVar11 = *(int *)(*(int *)(this + 0x1dc) + 0x30);
  if (0 < iVar11) {
    do {
      puVar10 = (undefined4 *)(iVar8 * 0x40 + *(int *)(this + 0x108));
      *local_58 = *puVar10;
      local_58[1] = puVar10[1];
      local_58[2] = puVar10[2];
      local_5c = local_5c + 1;
      if (local_60 < local_5c) {
        local_60 = local_5c;
      }
      iVar8 = iVar8 + 1;
      local_54 = local_54 + local_104;
      local_58 = (undefined4 *)((int)local_58 + local_110[0]);
      local_50 = local_50 + local_100;
      local_4c[0] = local_4c[0] + local_f8;
      local_4c[1] = local_4c[1] + local_f4;
      local_4c[2] = local_4c[2] + local_f0;
      local_4c[3] = local_4c[3] + local_ec;
      local_4c[4] = local_4c[4] + local_e8;
      local_4c[5] = local_4c[5] + local_e4;
      local_4c[6] = local_4c[6] + local_e0;
      local_4c[7] = local_4c[7] + local_dc;
    } while (iVar8 != iVar11);
  }
  iVar11 = 0;
  if (0 < *(int *)(this + 0x23c)) {
    do {
      local_128._0_2_ = (short)local_168;
      *(short *)(local_160 + local_124 * 2) =
           *(short *)(*(int *)(this + 0x240) + iVar11 * 2) + (short)local_128;
      local_124 = local_124 + local_154;
      if (local_12c < local_124) {
        local_12c = local_124;
      }
      iVar11 = iVar11 + 1;
    } while (iVar11 < *(int *)(this + 0x23c));
  }
  local_128 = iVar7;
  if (local_148 != '\0') {
    switch(local_14c) {
    case 4:
      iVar7 = local_60 * 2 + -2;
      break;
    case 5:
      iVar7 = local_60 * 2;
      break;
    case 6:
      iVar7 = local_60 * 3 + -6;
      break;
    case 7:
      iVar11 = local_60 * 6;
      iVar7 = iVar11 + 3;
      if (-1 < iVar11) {
        iVar7 = iVar11;
      }
      iVar7 = iVar7 >> 2;
      break;
    default:
      iVar7 = local_60;
      break;
    case 9:
      iVar7 = 0;
    }
    if (local_154 != 0) {
      if (iVar2 - local_124 < iVar7) {
        iVar7 = iVar2 - local_124;
      }
      if (iVar7 != 0) {
        puVar1 = (ushort *)(local_160 + local_124 * 2);
        switch(local_14c) {
        case 0:
        case 9:
          break;
        default:
          GenerateSequentialIndexBuffer(puVar1,iVar7,local_168);
          break;
        case 4:
          GenerateLineStripIndexBuffer(puVar1,iVar7,local_168);
          break;
        case 5:
          GenerateLineLoopIndexBuffer(puVar1,iVar7,local_168);
          break;
        case 6:
          GeneratePolygonIndexBuffer(puVar1,(int)puVar1,iVar7);
          break;
        case 7:
                    /* try { // try from 00133676 to 00133722 has its CatchHandler @ 00133728 */
          GenerateQuadIndexBuffer(puVar1,iVar7,local_168);
        }
        local_124 = local_124 + local_138 * iVar7;
        if (local_12c < local_124) {
          local_12c = local_124;
        }
      }
    }
  }
  (**(code **)(*local_150 + 0x58))(local_150,local_60,local_12c,local_204);
  local_134 = (int *)0x0;
  local_130 = 0;
  local_64 = 0;
  local_6c = (int *)0x0;
  local_c4 = 0xffffffff;
  (**(code **)(*local_150 + 0x34))(local_150,0xffffffff,0);
  local_150 = (int *)0x0;
  if ((local_6c != (int *)0x0) && (cVar4 = (**(code **)(*local_6c + 0x10))(local_6c), cVar4 != '\0')
     ) {
    (**(code **)(*local_6c + 0x18))(local_6c);
  }
  if ((local_134 != (int *)0x0) &&
     (cVar4 = (**(code **)(*local_134 + 0x10))(local_134), cVar4 != '\0')) {
    (**(code **)(*local_134 + 0x18))(local_134);
  }
  if ((piVar5 != (int *)0x0) && ((**(code **)(*piVar5 + 0xc))(piVar5), piVar5 != (int *)0x0)) {
    (**(code **)(*piVar5 + 4))(piVar5);
  }
  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)