L L4D2node

CBaseCombatCharacter::AddEntityRelationship

0x005f77f0 · 323 bytes · __thiscall

_ZN20CBaseCombatCharacter21AddEntityRelationshipEP11CBaseEntity13Disposition_ti

Decompiled

undefined (4 params)

/* CBaseCombatCharacter::AddEntityRelationship(CBaseEntity*, Disposition_t, int) */

void __thiscall
CBaseCombatCharacter::AddEntityRelationship
          (CBaseCombatCharacter *this,int *param_1,undefined4 param_3,int param_4)

{
  uint uVar1;
  int iVar2;
  int iVar3;
  undefined4 *puVar4;
  undefined *puVar5;
  int local_20;
  
  local_20 = *(int *)(this + 0x1854) + -1;
  if (-1 < local_20) {
    iVar2 = local_20 * 0x10;
    do {
      uVar1 = *(uint *)(*(int *)(this + 0x1848) + iVar2);
      if (((uVar1 == 0xffffffff) ||
          (puVar5 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar5 == (undefined *)0xfffffffc)) ||
         (*(uint *)(puVar5 + 8) != uVar1 >> 0xc)) {
        if (param_1 == (int *)0x0) goto LAB_005f7880;
      }
      else if (param_1 == *(int **)(puVar5 + 4)) {
LAB_005f7880:
        *(undefined4 *)(*(int *)(this + 0x1848) + iVar2 + 8) = param_3;
        if (param_4 == -0x80000000) {
          return;
        }
        *(int *)(*(int *)(this + 0x1848) + 0xc + iVar2) = param_4;
        return;
      }
      local_20 = local_20 + -1;
      iVar2 = iVar2 + -0x10;
    } while (local_20 != -1);
  }
  iVar3 = CUtlVector<Relationship_t,CUtlMemory<Relationship_t,int>>::InsertBefore
                    ((CUtlVector<Relationship_t,CUtlMemory<Relationship_t,int>> *)(this + 0x1848),
                     *(int *)(this + 0x1854));
  iVar3 = iVar3 * 0x10;
  *(undefined4 *)(*(int *)(this + 0x1848) + 4 + iVar3) = 0;
  iVar2 = *(int *)(this + 0x1848);
  if (param_1 == (int *)0x0) {
    *(undefined4 *)(iVar2 + iVar3) = 0xffffffff;
  }
  else {
    puVar4 = (undefined4 *)(**(code **)(*param_1 + 0xc))(param_1);
    *(undefined4 *)(iVar2 + iVar3) = *puVar4;
  }
  *(undefined4 *)(*(int *)(this + 0x1848) + 8 + iVar3) = param_3;
  iVar2 = 0;
  if (param_4 != -0x80000000) {
    iVar2 = param_4;
  }
  *(int *)(iVar3 + *(int *)(this + 0x1848) + 0xc) = iVar2;
  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)