L L4D2node

bf_write::WriteBitAngle

0x00098620 · 221 bytes · __thiscall

_ZN8bf_write13WriteBitAngleEfi

Decompiled

undefined (3 params)

/* bf_write::WriteBitAngle(float, int) */

void __thiscall bf_write::WriteBitAngle(bf_write *this,float param_1,int param_2)

{
  int iVar1;
  int iVar2;
  uint uVar3;
  uint uVar4;
  uint *puVar5;
  
  uVar4 = *(uint *)(this + 0xc);
  if ((int)(param_2 + uVar4) <= *(int *)(this + 8)) {
    uVar3 = (int)(param_1 * 0.0027777778 *
                 ((float)((&GetBitForBitnum(int)::bitsForBitnum)[param_2 & 0x1f] + -0x80000000) +
                 2.1474836e+09)) & (&GetBitForBitnum(int)::bitsForBitnum)[param_2 & 0x1f] - 1;
    iVar1 = ((int)uVar4 >> 5) * 4;
    uVar4 = uVar4 & 0x1f;
    puVar5 = (uint *)(iVar1 + *(int *)this);
    *puVar5 = (&g_BitWriteMasks)[uVar4 * 0x21 + param_2] & *puVar5 | uVar3 << (sbyte)uVar4;
    iVar2 = 0x20 - uVar4;
    if (iVar2 < param_2) {
      puVar5 = (uint *)(*(int *)this + 4 + iVar1);
      *puVar5 = uVar3 >> ((byte)iVar2 & 0x1f) | (&g_BitWriteMasks)[param_2 - iVar2] & *puVar5;
    }
    *(int *)(this + 0xc) = *(int *)(this + 0xc) + param_2;
    return;
  }
  *(int *)(this + 0xc) = *(int *)(this + 8);
  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)