L L4D2node

bf_write::WriteBitVec3Normal

0x00b65750 · 440 bytes · __thiscall

_ZN8bf_write18WriteBitVec3NormalERK6Vector

Decompiled

undefined (2 params)

/* bf_write::WriteBitVec3Normal(Vector const&) */

void __thiscall bf_write::WriteBitVec3Normal(bf_write *this,Vector *param_1)

{
  byte *pbVar1;
  float fVar2;
  bool bVar3;
  bool bVar4;
  int iVar5;
  byte bVar6;
  
  bVar3 = 0.0004885198 <= *(float *)param_1;
  bVar4 = *(float *)param_1 <= -0.0004885198;
  fVar2 = *(float *)(param_1 + 4);
  iVar5 = *(int *)(this + 0xc);
  if (iVar5 < *(int *)(this + 8)) {
    if (this[0x10] == (bf_write)0x0) {
      if (bVar3 || bVar4) {
        pbVar1 = (byte *)(*(int *)this + (iVar5 >> 3));
        *pbVar1 = *pbVar1 | (byte)(1 << ((byte)iVar5 & 7));
      }
      else {
        pbVar1 = (byte *)(*(int *)this + (iVar5 >> 3));
        *pbVar1 = *pbVar1 & ~(byte)(1 << ((byte)iVar5 & 7));
      }
      iVar5 = *(int *)(this + 0xc) + 1;
      *(int *)(this + 0xc) = iVar5;
      if (*(int *)(this + 8) <= iVar5) goto LAB_00b658b0;
    }
    if (this[0x10] == (bf_write)0x0) {
      if (0.0004885198 <= fVar2 || fVar2 <= -0.0004885198) {
        pbVar1 = (byte *)(*(int *)this + (iVar5 >> 3));
        *pbVar1 = *pbVar1 | (byte)(1 << ((byte)iVar5 & 7));
      }
      else {
        pbVar1 = (byte *)(*(int *)this + (iVar5 >> 3));
        *pbVar1 = *pbVar1 & ~(byte)(1 << ((byte)iVar5 & 7));
      }
      *(int *)(this + 0xc) = *(int *)(this + 0xc) + 1;
    }
    if (!bVar3 && !bVar4) goto LAB_00b6583d;
  }
  else {
LAB_00b658b0:
    this[0x10] = (bf_write)0x1;
    if (!bVar3 && !bVar4) goto LAB_00b6583d;
  }
  WriteBitNormal(this,*(float *)param_1);
LAB_00b6583d:
  if (0.0004885198 <= fVar2 || fVar2 <= -0.0004885198) {
    WriteBitNormal(this,*(float *)(param_1 + 4));
  }
  iVar5 = *(int *)(this + 0xc);
  if (iVar5 < *(int *)(this + 8)) {
    if (this[0x10] == (bf_write)0x0) {
      bVar6 = (byte)(1 << ((byte)iVar5 & 7));
      if (*(float *)(param_1 + 8) <= -0.0004885198) {
        pbVar1 = (byte *)(*(int *)this + (iVar5 >> 3));
        *pbVar1 = *pbVar1 | bVar6;
      }
      else {
        pbVar1 = (byte *)(*(int *)this + (iVar5 >> 3));
        *pbVar1 = *pbVar1 & ~bVar6;
      }
      *(int *)(this + 0xc) = *(int *)(this + 0xc) + 1;
    }
    return;
  }
  this[0x10] = (bf_write)0x1;
  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)