L L4D2node

CPistol::WeaponTranslateMainActivity

0x00555270 · 272 bytes · __thiscall

_ZN7CPistol27WeaponTranslateMainActivityE8Activity

Decompiled

undefined (2 params)

/* CPistol::WeaponTranslateMainActivity(Activity) */

undefined4 __thiscall CPistol::WeaponTranslateMainActivity(CPistol *this,int param_2)

{
  char cVar1;
  undefined4 uVar2;
  
  cVar1 = (**(code **)(*(int *)this + 0x674))(this);
  if (cVar1 == '\0') goto LAB_00555300;
  if (param_2 == 0x2d) {
    uVar2 = 0x433;
  }
  else if (param_2 < 0x2e) {
    if (param_2 == 10) {
      uVar2 = 0x432;
    }
    else if (param_2 < 0xb) {
      if (param_2 == 1) {
        uVar2 = 0x430;
      }
      else {
        uVar2 = 0x431;
        if (param_2 != 6) goto LAB_00555300;
      }
    }
    else if (param_2 == 0xc) {
      uVar2 = 0x434;
    }
    else {
      uVar2 = 0x207;
      if (param_2 != 0x1d) {
LAB_00555300:
        uVar2 = CTerrorWeapon::WeaponTranslateMainActivity();
        return uVar2;
      }
    }
  }
  else if (param_2 == 0x1ff) {
    uVar2 = 0x437;
  }
  else if (param_2 < 0x200) {
    if (param_2 == 0x1fc) {
      uVar2 = 0x435;
    }
    else {
      uVar2 = 0x436;
      if (param_2 != 0x1fe) goto LAB_00555300;
    }
  }
  else if (param_2 == 0x201) {
    uVar2 = 0x43c;
  }
  else if (param_2 < 0x201) {
    uVar2 = 0x43b;
  }
  else {
    uVar2 = 0x43d;
    if (param_2 != 0x202) goto LAB_00555300;
  }
  return uVar2;
}

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)