L L4D2node

CGameMovement::GetPlayerViewOffset

0x00452340 · 287 bytes · __thiscall

_ZNK13CGameMovement19GetPlayerViewOffsetEb

Decompiled

undefined (2 params)

/* CGameMovement::GetPlayerViewOffset(bool) const */

undefined1 * __thiscall CGameMovement::GetPlayerViewOffset(CGameMovement *this,bool param_1)

{
  undefined4 *puVar1;
  int iVar2;
  
  if (GetPlayerViewOffset(bool)::crouchedView == '\0') {
    iVar2 = __cxa_guard_acquire(&GetPlayerViewOffset(bool)::crouchedView);
    if (iVar2 != 0) {
      __cxa_guard_release(&GetPlayerViewOffset(bool)::crouchedView);
    }
  }
  if (GetPlayerViewOffset(bool)::standingView == '\0') {
    iVar2 = __cxa_guard_acquire(&GetPlayerViewOffset(bool)::standingView);
    if (iVar2 != 0) {
      __cxa_guard_release(&GetPlayerViewOffset(bool)::standingView);
    }
  }
  iVar2 = **(int **)(this + 4);
  if (!param_1) {
    puVar1 = (undefined4 *)(**(code **)(iVar2 + 0x250))();
    GetPlayerViewOffset(bool)::standingView._0_4_ = *puVar1;
    GetPlayerViewOffset(bool)::standingView._4_4_ = puVar1[1];
    GetPlayerViewOffset(bool)::standingView._8_4_ = puVar1[2];
    iVar2 = (**(code **)(*g_pGameRules + 0x7c))(g_pGameRules);
    GetPlayerViewOffset(bool)::standingView._8_4_ = *(undefined4 *)(iVar2 + 8);
    return GetPlayerViewOffset(bool)::standingView;
  }
  puVar1 = (undefined4 *)(**(code **)(iVar2 + 0x250))(*(int **)(this + 4));
  GetPlayerViewOffset(bool)::crouchedView._0_4_ = *puVar1;
  GetPlayerViewOffset(bool)::crouchedView._4_4_ = puVar1[1];
  GetPlayerViewOffset(bool)::crouchedView._8_4_ = puVar1[2];
  iVar2 = (**(code **)(*g_pGameRules + 0x7c))(g_pGameRules);
  GetPlayerViewOffset(bool)::crouchedView._8_4_ = *(undefined4 *)(iVar2 + 0x44);
  return GetPlayerViewOffset(bool)::crouchedView;
}

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)