L L4D2node

LinkChild

0x006d8840 · 402 bytes · __cdecl

_Z9LinkChildP11CBaseEntityS0_

Decompiled

undefined (2 params)

/* LinkChild(CBaseEntity*, CBaseEntity*) */

void LinkChild(CBaseEntity *param_1,CBaseEntity *param_2)

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