L L4D2node

CSheetSimulator::DetermineBestCollisionPlane

0x004b05b0 · 418 bytes · __thiscall

_ZN15CSheetSimulator27DetermineBestCollisionPlaneEb

Decompiled

undefined (2 params)

/* CSheetSimulator::DetermineBestCollisionPlane(bool) */

void __thiscall CSheetSimulator::DetermineBestCollisionPlane(CSheetSimulator *this,bool param_1)

{
  int iVar1;
  int iVar2;
  int iVar3;
  int local_20;
  
  if (0 < *(int *)(this + 4)) {
    iVar1 = *(int *)this;
    local_20 = 0;
    do {
      if (0 < iVar1) {
        iVar2 = local_20 * iVar1;
        *(undefined4 *)(*(int *)(this + 8) + 0x30 + iVar2 * 0x34) = 0x7f7fffff;
        *(undefined4 *)(*(int *)(this + 8) + 0x2c + iVar2 * 0x34) = 0xffffffff;
        TestVertAgainstPlane(this,iVar2,iVar2,param_1);
        iVar3 = 0;
        do {
          iVar1 = *(int *)this;
          if (iVar3 < iVar1 + -1) goto LAB_004b06ef;
          while( true ) {
            if (local_20 != 0) {
              TestVertAgainstPlane(this,iVar2,iVar2 - iVar1,param_1);
              iVar1 = *(int *)this;
            }
            if (local_20 < *(int *)(this + 4) + -1) {
              TestVertAgainstPlane(this,iVar2,iVar1 + iVar2,param_1);
              iVar1 = *(int *)this;
              if (iVar1 <= iVar3 + 1) goto LAB_004b0740;
            }
            else if (iVar1 <= iVar3 + 1) goto LAB_004b0740;
            iVar3 = iVar3 + 1;
            iVar2 = iVar1 * local_20 + iVar3;
            *(undefined4 *)(*(int *)(this + 8) + 0x30 + iVar2 * 0x34) = 0x7f7fffff;
            *(undefined4 *)(*(int *)(this + 8) + 0x2c + iVar2 * 0x34) = 0xffffffff;
            TestVertAgainstPlane(this,iVar2,iVar2,param_1);
            if (iVar3 < 1) break;
            TestVertAgainstPlane(this,iVar2,iVar2 + -1,param_1);
            iVar1 = *(int *)this;
            if (iVar3 < iVar1 + -1) {
LAB_004b06ef:
              TestVertAgainstPlane(this,iVar2,iVar2 + 1,param_1);
              iVar1 = *(int *)this;
            }
          }
        } while( true );
      }
LAB_004b0740:
      local_20 = local_20 + 1;
    } while (local_20 < *(int *)(this + 4));
  }
  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)