L L4D2node

CDamageModifier::RemoveModifier

0x00665d40 · 170 bytes · __thiscall

_ZN15CDamageModifier14RemoveModifierEv

Decompiled

undefined (1 param)

/* CDamageModifier::RemoveModifier() */

void __thiscall CDamageModifier::RemoveModifier(CDamageModifier *this)

{
  int *piVar1;
  uint uVar2;
  int iVar3;
  int iVar4;
  undefined *puVar5;
  
  uVar2 = *(uint *)(this + 4);
  if ((((uVar2 == 0xffffffff) ||
       (puVar5 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar5 == (undefined *)0xfffffffc)) ||
      (*(uint *)(puVar5 + 8) != uVar2 >> 0xc)) || (iVar3 = *(int *)(puVar5 + 4), iVar3 == 0)) {
    return;
  }
  iVar4 = *(int *)(iVar3 + 0x164);
  if (iVar4 != -1) {
    do {
      piVar1 = (int *)(*(int *)(iVar3 + 0x158) + iVar4 * 0xc);
      if (this == (CDamageModifier *)*piVar1) {
        CUtlLinkedList<CDamageModifier*,int,false,int,CUtlMemory<UtlLinkedListElem_t<CDamageModifier*,int>,int>>
        ::Unlink((CUtlLinkedList<CDamageModifier*,int,false,int,CUtlMemory<UtlLinkedListElem_t<CDamageModifier*,int>,int>>
                  *)(iVar3 + 0x158),iVar4);
        *(undefined4 *)(*(int *)(iVar3 + 0x158) + 8 + iVar4 * 0xc) = *(undefined4 *)(iVar3 + 0x16c);
        *(int *)(iVar3 + 0x16c) = iVar4;
        break;
      }
      iVar4 = piVar1[2];
    } while (iVar4 != -1);
  }
  *(undefined4 *)(this + 4) = 0xffffffff;
  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)