L L4D2node

SVC_FixAngle::WriteToBuffer

0x000a9300 · 342 bytes · __thiscall

_ZN12SVC_FixAngle13WriteToBufferER8bf_write

Decompiled

undefined (2 params)

/* SVC_FixAngle::WriteToBuffer(bf_write&) */

byte __thiscall SVC_FixAngle::WriteToBuffer(SVC_FixAngle *this,bf_write *param_1)

{
  byte *pbVar1;
  int iVar2;
  uint uVar3;
  int iVar4;
  uint uVar5;
  uint *puVar6;
  sbyte local_20;
  
  uVar3 = (**(code **)(*(int *)this + 0x24))(this);
  uVar5 = *(uint *)(param_1 + 0xc);
  if (*(int *)(param_1 + 8) < (int)(uVar5 + 6)) {
    *(int *)(param_1 + 0xc) = *(int *)(param_1 + 8);
  }
  else {
    iVar2 = ((int)uVar5 >> 5) * 4;
    uVar5 = uVar5 & 0x1f;
    puVar6 = (uint *)(iVar2 + *(int *)param_1);
    local_20 = (sbyte)uVar5;
    *puVar6 = uVar3 << local_20 | *puVar6 & *(uint *)(&DAT_003f2db8 + uVar5 * 0x84);
    iVar4 = 0x20 - uVar5;
    if (iVar4 < 6) {
      puVar6 = (uint *)(*(int *)param_1 + 4 + iVar2);
      *puVar6 = uVar3 >> ((byte)iVar4 & 0x1f) | (&g_BitWriteMasks)[6 - iVar4] & *puVar6;
    }
    iVar2 = *(int *)(param_1 + 0xc) + 6;
    *(int *)(param_1 + 0xc) = iVar2;
    if (iVar2 < *(int *)(param_1 + 8)) {
      if (param_1[0x10] == (bf_write)0x0) {
        if (this[0x4c] == (SVC_FixAngle)0x0) {
          pbVar1 = (byte *)(*(int *)param_1 + (iVar2 >> 3));
          *pbVar1 = *pbVar1 & ~(byte)(1 << ((byte)iVar2 & 7));
        }
        else {
          pbVar1 = (byte *)(*(int *)param_1 + (iVar2 >> 3));
          *pbVar1 = *pbVar1 | (byte)(1 << ((byte)iVar2 & 7));
        }
        *(int *)(param_1 + 0xc) = *(int *)(param_1 + 0xc) + 1;
      }
      goto LAB_000a93b2;
    }
  }
  param_1[0x10] = (bf_write)0x1;
LAB_000a93b2:
  bf_write::WriteBitAngle(param_1,*(float *)(this + 0x50),0x10);
  bf_write::WriteBitAngle(param_1,*(float *)(this + 0x54),0x10);
  bf_write::WriteBitAngle(param_1,*(float *)(this + 0x58),0x10);
  return (byte)param_1[0x10] ^ 1;
}

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)