L L4D2node

CWeaponSpawn::AbsorbWeapon

0x008d79e0 · 309 bytes · __thiscall

_ZN12CWeaponSpawn12AbsorbWeaponEP13CWeaponCSBase

Decompiled

undefined (2 params)

/* CWeaponSpawn::AbsorbWeapon(CWeaponCSBase*) */

undefined4 __thiscall CWeaponSpawn::AbsorbWeapon(CWeaponSpawn *this,CWeaponCSBase *param_1)

{
  CBaseEdict *this_00;
  char cVar1;
  int iVar2;
  int iVar3;
  uint *puVar4;
  uint uVar5;
  
  if ((param_1 != (CWeaponCSBase *)0x0) &&
     (((((byte)this[0x148] & 4) != 0 &&
       (iVar3 = (**(code **)(*(int *)param_1 + 0x530))(param_1), iVar3 != 2)) ||
      (cVar1 = (**(code **)(*(int *)param_1 + 0x670))(param_1), cVar1 == '\0')))) {
    iVar2 = (**(code **)(*(int *)param_1 + 0x530))(param_1);
    iVar3 = *(int *)(this + 0x144c);
    if ((iVar2 != 2) || (*(int *)(this + 0x1454) != iVar3)) {
      if (iVar3 == 0) {
        VisibilityMonitor_AddEntity
                  ((CBaseEntity *)this,400.0,WeaponSpawnVisibilityMonitorCallback,
                   CTerrorPlayer::DualWieldingFilter);
        uVar5 = *(uint *)(this + 0xd4) & 0xffffffdf;
        if (*(uint *)(this + 0xd4) == uVar5) {
          puVar4 = *(uint **)(this + 0x30);
        }
        else {
          if (this[0x6c] == (CWeaponSpawn)0x0) {
            this_00 = *(CBaseEdict **)(this + 0x30);
            puVar4 = (uint *)0x0;
            if (this_00 != (CBaseEdict *)0x0) {
              *(uint *)this_00 = *(uint *)this_00 | 0x101;
              iVar3 = CBaseEdict::GetChangeAccessor(this_00);
              *(undefined2 *)(iVar3 + 2) = 0;
              puVar4 = *(uint **)(this + 0x30);
            }
          }
          else {
            this[0x70] = (CWeaponSpawn)((byte)this[0x70] | 1);
            puVar4 = *(uint **)(this + 0x30);
          }
          *(uint *)(this + 0xd4) = uVar5;
        }
        if (puVar4 != (uint *)0x0) {
          *puVar4 = *puVar4 | 0x80;
        }
        CBaseEntity::DispatchUpdateTransmitState((CBaseEntity *)this);
        iVar3 = *(int *)(this + 0x144c);
      }
      *(int *)(this + 0x144c) = iVar3 + 1;
      CDirectorItemManager::RemoveItemFromScavengeCache
                (*(CDirectorItemManager **)(TheDirector + 0x62c),(CBaseEntity *)param_1);
      UTIL_Remove((CBaseEntity *)param_1);
      return 1;
    }
  }
  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)