L L4D2node

WeaponManager_RemoveManaged

0x006d1980 · 332 bytes · __cdecl

_Z27WeaponManager_RemoveManagedP11CBaseEntity

Decompiled

undefined (1 param)

/* WeaponManager_RemoveManaged(CBaseEntity*) */

void WeaponManager_RemoveManaged(CBaseEntity *param_1)

{
  int *piVar1;
  uint uVar2;
  int iVar3;
  uint uVar4;
  uint *puVar5;
  int iVar6;
  undefined *puVar7;
  int iVar8;
  int iVar9;
  
  iVar9 = 0;
  if (0 < DAT_00fe3594) {
LAB_006d19af:
    do {
      if (*(int *)(*(int *)(g_Managers + iVar9 * 4) + 0x440) == *(int *)(param_1 + 0x7c)) {
        puVar5 = (uint *)(**(code **)(*(int *)param_1 + 0xc))(param_1);
        uVar2 = *puVar5;
        iVar3 = *(int *)(g_Managers + iVar9 * 4);
        if (0 < *(int *)(iVar3 + 0x45c)) {
          piVar1 = (int *)(g_pEntityList + (uVar2 & 0xfff) * 0x10 + 4);
          iVar6 = 0;
          do {
            iVar8 = 0;
            if (uVar2 != 0xffffffff) {
              if (piVar1 == (int *)0x0) {
                iVar8 = 0;
              }
              else if (piVar1[1] == uVar2 >> 0xc) {
                iVar8 = *piVar1;
              }
            }
            uVar4 = *(uint *)(*(int *)(iVar3 + 0x450) + iVar6 * 4);
            if (((uVar4 == 0xffffffff) ||
                (puVar7 = g_pEntityList + (uVar4 & 0xfff) * 0x10, puVar7 == (undefined *)0xfffffffc)
                ) || (*(uint *)(puVar7 + 8) != uVar4 >> 0xc)) {
              if (iVar8 == 0) goto LAB_006d1a90;
            }
            else if (iVar8 == *(int *)(puVar7 + 4)) {
LAB_006d1a90:
              iVar9 = iVar9 + 1;
              CUtlVector<CHandle<CBaseEntity>,CUtlMemory<CHandle<CBaseEntity>,int>>::FastRemove
                        ((CUtlVector<CHandle<CBaseEntity>,CUtlMemory<CHandle<CBaseEntity>,int>> *)
                         (iVar3 + 0x450),iVar6);
              if (DAT_00fe3594 <= iVar9) {
                return;
              }
              goto LAB_006d19af;
            }
            iVar6 = iVar6 + 1;
          } while (iVar6 != *(int *)(iVar3 + 0x45c));
        }
      }
      iVar9 = iVar9 + 1;
    } while (iVar9 < DAT_00fe3594);
  }
  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)