L L4D2node

WeaponManager_AddManaged

0x006d1cc0 · 187 bytes · __cdecl

_Z24WeaponManager_AddManagedP11CBaseEntity

Decompiled

undefined (1 param)

/* WeaponManager_AddManaged(CBaseEntity*) */

void WeaponManager_AddManaged(CBaseEntity *param_1)

{
  undefined4 uVar1;
  int iVar2;
  undefined4 *puVar3;
  int iVar4;
  
  if (0 < DAT_00fe3594) {
    if (*(int *)(*g_Managers + 0x440) == *(int *)(param_1 + 0x7c)) {
      iVar4 = 0;
    }
    else {
      iVar2 = 0;
      do {
        iVar2 = iVar2 + 1;
        if (iVar2 == DAT_00fe3594) {
          return;
        }
        iVar4 = iVar2 * 4;
      } while (*(int *)(g_Managers[iVar2] + 0x440) != *(int *)(param_1 + 0x7c));
    }
    puVar3 = (undefined4 *)(**(code **)(*(int *)param_1 + 0xc))(param_1);
    uVar1 = *puVar3;
    iVar4 = *(int *)((int)g_Managers + iVar4);
    iVar2 = *(int *)(iVar4 + 0x45c);
    CUtlVector<CHandle<CBaseEntity>,CUtlMemory<CHandle<CBaseEntity>,int>>::GrowVector
              ((CUtlVector<CHandle<CBaseEntity>,CUtlMemory<CHandle<CBaseEntity>,int>> *)
               (iVar4 + 0x450),1);
    CUtlVector<CHandle<CBaseEntity>,CUtlMemory<CHandle<CBaseEntity>,int>>::ShiftElementsRight
              ((CUtlVector<CHandle<CBaseEntity>,CUtlMemory<CHandle<CBaseEntity>,int>> *)
               (iVar4 + 0x450),iVar2,1);
    puVar3 = (undefined4 *)(*(int *)(iVar4 + 0x450) + iVar2 * 4);
    if (puVar3 != (undefined4 *)0x0) {
      *puVar3 = uVar1;
      return;
    }
  }
  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)