L L4D2node

CBaseCombatCharacter::RemoveEntityRelationship

0x005efb20 · 227 bytes · __thiscall

_ZN20CBaseCombatCharacter24RemoveEntityRelationshipEP11CBaseEntity

Decompiled

undefined (2 params)

/* CBaseCombatCharacter::RemoveEntityRelationship(CBaseEntity*) */

undefined4 __thiscall
CBaseCombatCharacter::RemoveEntityRelationship(CBaseCombatCharacter *this,CBaseEntity *param_1)

{
  uint uVar1;
  int iVar2;
  int iVar3;
  int iVar4;
  uint *puVar5;
  undefined *puVar6;
  
  iVar2 = *(int *)(this + 0x1854) + -1;
  if (-1 < iVar2) {
    puVar5 = (uint *)(iVar2 * 0x10 + *(int *)(this + 0x1848));
    iVar4 = iVar2;
    do {
      uVar1 = *puVar5;
      if (((uVar1 == 0xffffffff) ||
          (puVar6 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar6 == (undefined *)0xfffffffc)) ||
         (*(uint *)(puVar6 + 8) != uVar1 >> 0xc)) {
        if (param_1 == (CBaseEntity *)0x0) goto LAB_005efbb0;
      }
      else if (param_1 == *(CBaseEntity **)(puVar6 + 4)) {
LAB_005efbb0:
        iVar3 = (*(int *)(this + 0x1854) - iVar4) + -1;
        if (0 < iVar3) {
          _V_memmove(puVar5,(void *)((iVar4 + 1) * 0x10 + *(int *)(this + 0x1848)),iVar3 * 0x10);
          iVar2 = *(int *)(this + 0x1854) + -1;
        }
        *(int *)(this + 0x1854) = iVar2;
        return 1;
      }
      iVar4 = iVar4 + -1;
      puVar5 = puVar5 + -4;
    } while (iVar4 != -1);
  }
  return 0;
}

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)