L L4D2node

old_bf_read::ReadBitAngle

0x00243140 · 257 bytes · __thiscall

_ZN11old_bf_read12ReadBitAngleEi

Decompiled

undefined (2 params)

/* old_bf_read::ReadBitAngle(int) */

longdouble __thiscall old_bf_read::ReadBitAngle(old_bf_read *this,int param_1)

{
  int iVar1;
  int iVar2;
  uint uVar3;
  int iVar4;
  uint uVar5;
  
  iVar1 = (&GetBitForBitnum(int)::bitsForBitnum)[param_1 & 0x1f];
  iVar2 = *(int *)(this + 0xc);
  uVar3 = param_1 + iVar2;
  if (*(int *)(this + 8) < (int)uVar3) {
    *(int *)(this + 0xc) = *(int *)(this + 8);
    this[0x10] = (old_bf_read)0x1;
    return (longdouble)0.0;
  }
  iVar4 = iVar2 >> 5;
  uVar5 = *(uint *)(*(int *)this + iVar4 * 4);
  *(uint *)(this + 0xc) = uVar3;
  uVar5 = uVar5 >> ((byte)iVar2 & 0x1f);
  if (iVar4 != (int)(uVar3 - 1) >> 5) {
    return (longdouble)
           ((float)(int)(((&g_ExtraMasks)[uVar3 & 0x1f] & *(uint *)(*(int *)this + 4 + iVar4 * 4))
                         << ((char)param_1 - (char)(uVar3 & 0x1f) & 0x1fU) | uVar5) *
           (360.0 / (float)iVar1));
  }
  if (param_1 != 0x20) {
    uVar5 = uVar5 & (&g_ExtraMasks)[param_1];
  }
  return (longdouble)((float)(int)uVar5 * (360.0 / (float)iVar1));
}

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)