L L4D2node

UnlinkChild

0x006d86b0 · 379 bytes · __cdecl

_Z11UnlinkChildP11CBaseEntityS0_

Decompiled

undefined (2 params)

/* UnlinkChild(CBaseEntity*, CBaseEntity*) */

void UnlinkChild(CBaseEntity *param_1,CBaseEntity *param_2)

{
  uint uVar1;
  CBaseEdict *this;
  CBaseEntity *this_00;
  CBaseEntity *pCVar2;
  undefined4 *puVar3;
  int iVar4;
  undefined *puVar5;
  CBaseEntity *pCVar6;
  
  uVar1 = *(uint *)(param_1 + 0x18c);
  if (((uVar1 != 0xffffffff) &&
      (puVar5 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar5 != (undefined *)0xfffffffc)) &&
     (*(uint *)(puVar5 + 8) == uVar1 >> 0xc)) {
    pCVar2 = param_1 + 0x18c;
    this_00 = *(CBaseEntity **)(puVar5 + 4);
    while (this_00 != (CBaseEntity *)0x0) {
      uVar1 = *(uint *)(this_00 + 400);
      pCVar6 = (CBaseEntity *)0x0;
      if (((uVar1 != 0xffffffff) &&
          (puVar5 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar5 != (undefined *)0xfffffffc)) &&
         (*(uint *)(puVar5 + 8) == uVar1 >> 0xc)) {
        pCVar6 = *(CBaseEntity **)(puVar5 + 4);
      }
      if (this_00 == param_2) {
        if (pCVar6 == (CBaseEntity *)0x0) {
          *(undefined4 *)pCVar2 = 0xffffffff;
        }
        else {
          puVar3 = (undefined4 *)(**(code **)(*(int *)pCVar6 + 0xc))(pCVar6);
          *(undefined4 *)pCVar2 = *puVar3;
        }
        uVar1 = *(uint *)(this_00 + 0x188);
        if (((uVar1 != 0xffffffff) &&
            (puVar5 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar5 != (undefined *)0xfffffffc)) &&
           ((*(uint *)(puVar5 + 8) == uVar1 >> 0xc && (*(int *)(puVar5 + 4) != 0)))) {
          if (this_00[0x6c] == (CBaseEntity)0x0) {
            this = *(CBaseEdict **)(this_00 + 0x30);
            if (this != (CBaseEdict *)0x0) {
              *(uint *)this = *(uint *)this | 0x101;
              iVar4 = CBaseEdict::GetChangeAccessor(this);
              *(undefined2 *)(iVar4 + 2) = 0;
            }
          }
          else {
            this_00[0x70] = (CBaseEntity)((byte)this_00[0x70] | 1);
          }
          *(undefined4 *)(this_00 + 0x188) = 0xffffffff;
        }
        *(undefined4 *)(this_00 + 400) = 0xffffffff;
        *(undefined4 *)(this_00 + 0x58) = 0xffffffff;
        CBaseEntity::DispatchUpdateTransmitState(this_00);
        (**(code **)(*(int *)this_00 + 0x198))(this_00,2,0);
        CBaseEntity::RecalcHasPlayerChildBit(param_1);
        return;
      }
      pCVar2 = this_00 + 400;
      this_00 = pCVar6;
    }
  }
  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)