L L4D2node

CSheetSimulator::TestVertAgainstPlane

0x004b0020 · 313 bytes · __thiscall

_ZN15CSheetSimulator20TestVertAgainstPlaneEiib

Decompiled

undefined (4 params)

/* CSheetSimulator::TestVertAgainstPlane(int, int, bool) */

void __thiscall
CSheetSimulator::TestVertAgainstPlane(CSheetSimulator *this,int param_1,int param_2,bool param_3)

{
  float fVar1;
  int iVar2;
  int iVar3;
  longdouble lVar4;
  float local_6c;
  float local_68;
  float local_64;
  float local_5c;
  float local_58;
  float local_54;
  undefined4 local_4c;
  undefined4 local_48;
  undefined4 local_44;
  undefined4 local_3c;
  undefined4 local_38;
  undefined4 local_34;
  undefined4 local_2c;
  undefined1 local_28;
  undefined1 local_27;
  
  if (*(char *)(*(int *)(this + 0x94) + param_2) != '\0') {
    local_6c = *(float *)(this + 0x60);
    local_68 = *(float *)(this + 100);
    local_64 = *(float *)(this + 0x68);
    iVar3 = param_1 * 0x34;
    iVar2 = iVar3 + *(int *)(this + 8);
    local_5c = *(float *)(iVar2 + 4) - local_6c;
    local_58 = *(float *)(iVar2 + 8) - local_68;
    local_54 = *(float *)(iVar2 + 0xc) - local_64;
    local_2c = 0;
    local_28 = 1;
    local_34 = 0;
    local_38 = 0;
    local_3c = 0;
    local_27 = local_58 * local_58 + local_54 * local_54 + local_5c * local_5c != 0.0;
    local_44 = 0;
    local_48 = 0;
    local_4c = 0;
    lVar4 = (longdouble)
            IntersectRayWithPlane
                      ((Ray_t *)&local_6c,(cplane_t *)(*(int *)(this + 0x90) + param_2 * 0x14));
    fVar1 = (float)lVar4;
    if ((((fVar1 <= 1.0) || (!param_3)) && (fVar1 < *(float *)(*(int *)(this + 8) + iVar3 + 0x30)))
       && (0.0 <= fVar1)) {
      *(float *)(*(int *)(this + 8) + iVar3 + 0x30) = fVar1;
      *(int *)(*(int *)(this + 8) + 0x2c + iVar3) = param_2;
    }
  }
  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)