L L4D2node

CTerrorWeapon::GetViewModel

0x00574e50 · 220 bytes · __cdecl

_ZNK13CTerrorWeapon12GetViewModelEi

Decompiled

undefined (1 param)

/* CTerrorWeapon::GetViewModel(int) const */

void CTerrorWeapon::GetViewModel(int param_1)

{
  char cVar1;
  bool bVar2;
  CBaseEntity *this;
  int iVar3;
  char *pcVar4;
  CTerrorWeaponInfo *pCVar5;
  undefined4 uVar6;
  undefined4 uStack00000008;
  
  this = (CBaseEntity *)GetPlayerOwner((CTerrorWeapon *)param_1);
  if (this != (CBaseEntity *)0x0) {
    iVar3 = CBaseEntity::GetTeamNumber(this);
    cVar1 = IsASurvivorTeam(iVar3);
    if (cVar1 == '\0') {
      iVar3 = CBaseEntity::GetTeamNumber(this);
      if (iVar3 != 3) goto LAB_00574e8b;
      iVar3 = CBaseEntity::GetTeamNumber(this);
      cVar1 = IsASurvivorTeam(iVar3);
      uVar6 = 9;
      if (cVar1 == '\0') {
        uVar6 = *(undefined4 *)(this + 0x2ba4);
      }
      pcVar4 = (char *)ZombieClassName(uVar6);
      pCVar5 = (CTerrorWeaponInfo *)CBaseCombatWeapon::GetWpnData((CBaseCombatWeapon *)param_1);
      CTerrorWeaponInfo::GetViewModelName(pCVar5,pcVar4,false);
    }
    else {
      bVar2 = (bool)(**(code **)(*(int *)param_1 + 0x674))(param_1);
      pcVar4 = (char *)SurvivorCharacterName(*(undefined4 *)(this + 0x2ba0));
      pCVar5 = (CTerrorWeaponInfo *)CBaseCombatWeapon::GetWpnData((CBaseCombatWeapon *)param_1);
      CTerrorWeaponInfo::GetViewModelName(pCVar5,pcVar4,bVar2);
    }
    return;
  }
LAB_00574e8b:
  uStack00000008 = 0;
  CWeaponCSBase::GetViewModel(param_1);
  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)