L L4D2node

Infected::RequestWound

0x00a0ea70 · 565 bytes · __thiscall

_ZN8Infected12RequestWoundEi

Decompiled

undefined (2 params)

/* Infected::RequestWound(int) */

undefined4 __thiscall Infected::RequestWound(Infected *this,int param_1)

{
  CBaseEdict *pCVar1;
  undefined4 uVar2;
  undefined4 uVar3;
  int *piVar4;
  int iVar5;
  int iVar6;
  
  uVar2 = UTIL_IsLowViolence();
  if ((char)uVar2 != '\0') {
    return 0;
  }
  if (*(int *)(z_skip_wounds._28_4_ + 0x30) == 1) {
    return uVar2;
  }
  if (param_1 == -1) {
    if (*(int *)(this + 0x1cf4) != -1) {
      if (this[0x6c] == (Infected)0x0) {
        pCVar1 = *(CBaseEdict **)(this + 0x30);
        if (pCVar1 != (CBaseEdict *)0x0) {
          *(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
          iVar5 = CBaseEdict::GetChangeAccessor(pCVar1);
          *(undefined2 *)(iVar5 + 2) = 0;
        }
      }
      else {
        this[0x70] = (Infected)((byte)this[0x70] | 1);
      }
      *(undefined4 *)(this + 0x1cf4) = 0xffffffff;
    }
    if (*(int *)(this + 0x1cf8) == -1) {
      return 1;
    }
  }
  else {
    if (((*(int *)(this + 0x1cf4) == param_1) || (*(int *)(this + 0x1cf8) == param_1)) ||
       (*(int *)(this + 0x1cf8) != -1)) {
      return uVar2;
    }
    uVar3 = CBaseEntity::GetGender((CBaseEntity *)this);
    piVar4 = (int *)GetDamageCutoutInfoArray(uVar3);
    if (piVar4[3] <= param_1) {
      return uVar2;
    }
    iVar5 = param_1 * 0xf6c + *piVar4;
    if (*(int *)(iVar5 + 0x14) != 0) {
      if (*(int *)(this + 0x1cf4) == -1) {
        if (this[0x6c] == (Infected)0x0) {
          pCVar1 = *(CBaseEdict **)(this + 0x30);
          if (pCVar1 != (CBaseEdict *)0x0) {
            *(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
            iVar5 = CBaseEdict::GetChangeAccessor(pCVar1);
            *(undefined2 *)(iVar5 + 2) = 0;
          }
        }
        else {
          this[0x70] = (Infected)((byte)this[0x70] | 1);
        }
        *(int *)(this + 0x1cf4) = param_1;
        return 1;
      }
      iVar6 = *(int *)(this + 0x1cf4) * 0xf6c + *piVar4;
      if (1 < *(int *)(iVar6 + 0xf08)) {
        return uVar2;
      }
      if (1 < *(int *)(iVar5 + 0xf08)) {
        return uVar2;
      }
      if (0 < *(int *)(iVar6 + 0x540)) {
        if (param_1 == *(int *)(iVar6 + 0x518)) {
          return uVar2;
        }
        iVar5 = 0;
        while (iVar5 = iVar5 + 1, iVar5 != *(int *)(iVar6 + 0x540)) {
          if (param_1 == *(int *)(iVar6 + 0x518 + iVar5 * 4)) {
            return uVar2;
          }
        }
      }
      if (param_1 != *(int *)(this + 0x1cf8)) {
        if (this[0x6c] == (Infected)0x0) {
          pCVar1 = *(CBaseEdict **)(this + 0x30);
          if (pCVar1 != (CBaseEdict *)0x0) {
            *(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
            iVar5 = CBaseEdict::GetChangeAccessor(pCVar1);
            *(undefined2 *)(iVar5 + 2) = 0;
          }
        }
        else {
          this[0x70] = (Infected)((byte)this[0x70] | 1);
        }
        *(int *)(this + 0x1cf8) = param_1;
        return 1;
      }
      return 1;
    }
    if (param_1 != *(int *)(this + 0x1cf4)) {
      if (this[0x6c] == (Infected)0x0) {
        pCVar1 = *(CBaseEdict **)(this + 0x30);
        if (pCVar1 != (CBaseEdict *)0x0) {
          *(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
          iVar5 = CBaseEdict::GetChangeAccessor(pCVar1);
          *(undefined2 *)(iVar5 + 2) = 0;
        }
      }
      else {
        this[0x70] = (Infected)((byte)this[0x70] | 1);
      }
      *(int *)(this + 0x1cf4) = param_1;
    }
    if (*(int *)(this + 0x1cf8) == -1) {
      return 1;
    }
  }
  if (this[0x6c] == (Infected)0x0) {
    pCVar1 = *(CBaseEdict **)(this + 0x30);
    if (pCVar1 != (CBaseEdict *)0x0) {
      *(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
      iVar5 = CBaseEdict::GetChangeAccessor(pCVar1);
      *(undefined2 *)(iVar5 + 2) = 0;
    }
  }
  else {
    this[0x70] = (Infected)((byte)this[0x70] | 1);
  }
  *(undefined4 *)(this + 0x1cf8) = 0xffffffff;
  return 1;
}

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)