L L4D2node

CBaseCombatWeapon::SetViewModel

0x004063a0 · 127 bytes · __thiscall

_ZN17CBaseCombatWeapon12SetViewModelEv

Decompiled

undefined (1 param)

/* CBaseCombatWeapon::SetViewModel() */

void __thiscall CBaseCombatWeapon::SetViewModel(CBaseCombatWeapon *this)

{
  code *pcVar1;
  char cVar2;
  CBasePlayer *this_00;
  int *piVar3;
  undefined4 uVar4;
  
  this_00 = (CBasePlayer *)GetOwner(this);
  if (this_00 != (CBasePlayer *)0x0) {
    cVar2 = (**(code **)(*(int *)this_00 + 0x16c))(this_00);
    if (cVar2 != '\0') {
      piVar3 = (int *)CBasePlayer::GetViewModel(this_00,*(int *)(this + 0x13f8));
      if (piVar3 != (int *)0x0) {
        pcVar1 = *(code **)(*piVar3 + 0x3a8);
        uVar4 = (**(code **)(*(int *)this + 0x504))(this,*(undefined4 *)(this + 0x13f8));
        (*pcVar1)(piVar3,uVar4,this);
        piVar3[0x116] = *(int *)(this + 0x458);
      }
    }
  }
  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)