L L4D2node

CDispCollTree::AddPlane

0x000ce220 · 509 bytes · __thiscall

_ZN13CDispCollTree8AddPlaneERK6Vector

Decompiled

undefined (2 params)

/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* CDispCollTree::AddPlane(Vector const&) */

float __thiscall CDispCollTree::AddPlane(CDispCollTree *this,Vector *param_1)

{
  CUtlVector<DispCollPlaneIndex_t,CUtlMemory<DispCollPlaneIndex_t,int>> *this_00;
  uint uVar1;
  uint uVar2;
  float fVar3;
  float *pfVar4;
  uint uVar5;
  float local_38;
  float local_34;
  float local_30;
  float local_2c;
  float local_28;
  float local_24;
  float local_20;
  
  local_2c = *(float *)param_1;
  local_20 = *(float *)(this + 0xd0);
  local_28 = *(float *)(param_1 + 4);
  local_24 = *(float *)(param_1 + 8);
  uVar1 = Hash12(&local_2c);
  local_30 = -local_24;
  local_34 = -local_28;
  local_38 = -local_2c;
  uVar2 = Hash12(&local_38);
  if (DAT_00343ad6 == '\0') {
    uVar1 = (uVar2 ^ uVar1) % DAT_00343acc;
  }
  else {
    uVar1 = (uVar2 ^ uVar1) & _DAT_00343ad8;
  }
  this_00 = (CUtlVector<DispCollPlaneIndex_t,CUtlMemory<DispCollPlaneIndex_t,int>> *)
            (g_DispCollPlaneIndexHash + uVar1 * 0x14);
  uVar2 = *(uint *)(this_00 + 0xc);
  if ((int)uVar2 < 1) {
    uVar5 = 0;
LAB_000ce315:
    if (uVar2 != uVar5) {
      pfVar4 = (float *)((uVar5 & 0xffff) * 0x10 +
                        *(int *)(g_DispCollPlaneIndexHash + ((uVar1 << 0x10 | uVar5) >> 0x10) * 0x14
                                ));
      if (((*(float *)param_1 == *pfVar4) && (*(float *)(param_1 + 4) == pfVar4[1])) &&
         (*(float *)(param_1 + 8) == pfVar4[2])) {
        fVar3 = pfVar4[3];
      }
      else {
        fVar3 = (float)((uint)pfVar4[3] | 0x8000);
      }
      return fVar3;
    }
  }
  else {
    uVar5 = 0;
    pfVar4 = *(float **)this_00;
    do {
      if ((((local_2c == *pfVar4) && (local_28 == pfVar4[1])) && (local_24 == pfVar4[2])) ||
         (((*pfVar4 == -local_2c && (-local_28 == pfVar4[1])) && (-local_24 == pfVar4[2]))))
      goto LAB_000ce315;
      uVar5 = uVar5 + 1;
      pfVar4 = pfVar4 + 4;
    } while (uVar5 != uVar2);
  }
  CUtlVector<DispCollPlaneIndex_t,CUtlMemory<DispCollPlaneIndex_t,int>>::GrowVector(this_00,1);
  CUtlVector<DispCollPlaneIndex_t,CUtlMemory<DispCollPlaneIndex_t,int>>::ShiftElementsRight
            (this_00,uVar2,1);
  pfVar4 = (float *)(uVar2 * 0x10 + *(int *)this_00);
  if (pfVar4 != (float *)0x0) {
    *pfVar4 = local_2c;
    pfVar4[1] = local_28;
    pfVar4[2] = local_24;
    pfVar4[3] = local_20;
  }
  fVar3 = (float)CUtlVector<Vector,CUtlMemory<Vector,int>>::InsertBefore
                           ((CUtlVector<Vector,CUtlMemory<Vector,int>> *)(this + 0xc4),
                            *(int *)(this + 0xd0),param_1);
  return fVar3;
}

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)