L L4D2node

Infected::CheckForCustomWoundEffect

0x00a0ef90 · 260 bytes · __thiscall

_ZN8Infected25CheckForCustomWoundEffectEii

Decompiled

undefined (3 params)

/* Infected::CheckForCustomWoundEffect(int, int) */

undefined4 __thiscall Infected::CheckForCustomWoundEffect(Infected *this,int param_1,int param_2)

{
  int iVar1;
  undefined4 uVar2;
  undefined4 *puVar3;
  int *piVar4;
  int iVar5;
  int *piVar6;
  int iVar7;
  int iVar8;
  int aiStack_3c [11];
  
  if ((*(int *)(this + 0x1cf4) != -1) && (*(int *)(this + 0x1cf8) != -1)) {
    return 0;
  }
  uVar2 = CBaseEntity::GetGender((CBaseEntity *)this);
  puVar3 = (undefined4 *)GetDamageCutoutInfoArray(uVar2);
  iVar5 = puVar3[3];
  if (0 < iVar5) {
    piVar6 = (int *)*puVar3;
    iVar7 = 0;
    iVar8 = 0;
LAB_00a0eff0:
    do {
      if ((param_1 & piVar6[0x171]) != 0) {
        if (param_2 == -1) {
          aiStack_3c[iVar8] = iVar7;
          iVar7 = iVar7 + 1;
          iVar8 = iVar8 + 1;
          piVar6 = piVar6 + 0x3db;
          if (iVar7 == iVar5) break;
          goto LAB_00a0eff0;
        }
        iVar1 = piVar6[5];
        if (0 < iVar1) {
          piVar4 = piVar6;
          do {
            while ((*piVar4 < 0 || (param_2 != *piVar4))) {
              piVar4 = piVar4 + 1;
              if (piVar4 == piVar6 + iVar1) goto LAB_00a0f030;
            }
            piVar4 = piVar4 + 1;
            aiStack_3c[iVar8] = iVar7;
            iVar8 = iVar8 + 1;
          } while (piVar4 != piVar6 + iVar1);
        }
      }
LAB_00a0f030:
      iVar7 = iVar7 + 1;
      piVar6 = piVar6 + 0x3db;
    } while (iVar7 != iVar5);
    if (iVar8 != 0) {
      iVar5 = RandomInt(0,iVar8 + -1);
      RequestWound(this,aiStack_3c[iVar5]);
      return 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)