L L4D2node

CWeaponSpawn::GetUseType

0x008d6df0 · 198 bytes · __thiscall

_ZN12CWeaponSpawn10GetUseTypeEP11CBaseEntity

Decompiled

undefined (2 params)

/* CWeaponSpawn::GetUseType(CBaseEntity*) */

undefined4 __thiscall CWeaponSpawn::GetUseType(CWeaponSpawn *this,CBaseEntity *param_1)

{
  code *pcVar1;
  char cVar2;
  int iVar3;
  int iVar4;
  undefined4 *puVar5;
  undefined4 uVar6;
  undefined4 uVar7;
  
  if (param_1 == (CBaseEntity *)0x0) {
    return 0;
  }
  cVar2 = (**(code **)(*(int *)param_1 + 0x16c))(param_1);
  if (cVar2 != '\0') {
    uVar7 = *(undefined4 *)(this + 0x1458);
    iVar3 = GetWeaponInfo(uVar7);
    if ((iVar3 == 0) || (iVar4 = GetAmmoDef(), iVar4 == 0)) {
      uVar6 = 0xffffffff;
    }
    else {
      puVar5 = (undefined4 *)GetAmmoDef();
      pcVar1 = *(code **)*puVar5;
      uVar6 = (**(code **)(*(int *)param_1 + 0x144))(param_1);
      uVar6 = (*pcVar1)(puVar5,*(undefined4 *)(iVar3 + 0x850),uVar6);
    }
    uVar7 = GetUseTypeForWeapon(param_1,uVar7,0xffffffff,uVar6,0,0);
    return uVar7;
  }
  return 0;
}

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)