L L4D2node

CChainsaw::UpdateOwnerAndViewmodel

0x00532090 · 235 bytes · __thiscall

_ZN9CChainsaw23UpdateOwnerAndViewmodelEv

Decompiled

undefined (1 param)

/* CChainsaw::UpdateOwnerAndViewmodel() */

void __thiscall CChainsaw::UpdateOwnerAndViewmodel(CChainsaw *this)

{
  CBasePlayer *this_00;
  CBaseEntity *this_01;
  undefined4 uVar1;
  int iVar2;
  CStudioHdr *pCVar3;
  CStudioHdr *pCVar4;
  
  this_00 = (CBasePlayer *)CTerrorWeapon::GetPlayerOwner((CTerrorWeapon *)this);
  *(undefined4 *)(this + 0x1808) = 0;
  *(CBasePlayer **)(this + 0x1804) = this_00;
  if (this_00 == (CBasePlayer *)0x0) {
    return;
  }
  this_01 = (CBaseEntity *)CBasePlayer::GetViewModel(this_00,*(int *)(this + 0x13f8));
  *(CBaseEntity **)(this + 0x1808) = this_01;
  if (this_01 == (CBaseEntity *)0x0) {
    return;
  }
  pCVar3 = *(CStudioHdr **)(this_01 + 0x13e0);
  if (pCVar3 == (CStudioHdr *)0x0) {
    iVar2 = CBaseEntity::GetModel(this_01);
    if (iVar2 == 0) {
      pCVar3 = *(CStudioHdr **)(this_01 + 0x13e0);
    }
    else {
      CBaseAnimating::LockStudioHdr((CBaseAnimating *)this_01);
      pCVar3 = *(CStudioHdr **)(this_01 + 0x13e0);
    }
    pCVar4 = (CStudioHdr *)0x0;
    if (pCVar3 == (CStudioHdr *)0x0) goto LAB_005320e8;
  }
  pCVar4 = (CStudioHdr *)0x0;
  if (*(int *)pCVar3 != 0) {
    pCVar4 = pCVar3;
  }
LAB_005320e8:
  if (*(int *)(this + 0x1830) == -1) {
    uVar1 = CBaseAnimating::LookupPoseParameter
                      (*(CBaseAnimating **)(this + 0x1808),pCVar4,"engine_on");
    *(undefined4 *)(this + 0x1830) = uVar1;
  }
  if (*(int *)(this + 0x1834) != -1) {
    return;
  }
  uVar1 = CBaseAnimating::LookupPoseParameter(*(CBaseAnimating **)(this + 0x1808),pCVar4,"attack");
  *(undefined4 *)(this + 0x1834) = uVar1;
  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)