L L4D2node

CTriggerHurt::HurtAllTouchers

0x00b20eb0 · 356 bytes · __thiscall

_ZN12CTriggerHurt15HurtAllTouchersEf

Decompiled

undefined (2 params)

/* CTriggerHurt::HurtAllTouchers(float) */

int __thiscall CTriggerHurt::HurtAllTouchers(CTriggerHurt *this,float param_1)

{
  undefined4 uVar1;
  uint uVar2;
  char cVar3;
  uint *puVar4;
  undefined *puVar5;
  uint *puVar6;
  int iVar7;
  float fVar8;
  
  fVar8 = *(float *)(this + 0x570);
  uVar1 = *(undefined4 *)(gpGlobals + 0xc);
  *(undefined4 *)(this + 0x5dc) = 0;
  *(undefined4 *)(this + 0x578) = uVar1;
  puVar4 = (uint *)CBaseEntity::GetDataObject((CBaseEntity *)this,1);
  if ((puVar4 == (uint *)0x0) || (puVar6 = (uint *)puVar4[2], puVar4 == puVar6)) {
    if (*(int *)(this + 0x584) != 1) {
      return 0;
    }
  }
  else {
    iVar7 = 0;
    do {
      while ((((uVar2 = *puVar6, uVar2 != 0xffffffff &&
               (puVar5 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar5 != (undefined *)0xfffffffc))
              && (*(uint *)(puVar5 + 8) == uVar2 >> 0xc)) &&
             (*(CBaseEntity **)(puVar5 + 4) != (CBaseEntity *)0x0))) {
        cVar3 = HurtEntity(this,*(CBaseEntity **)(puVar5 + 4),param_1 * fVar8);
        puVar6 = (uint *)puVar6[2];
        iVar7 = (iVar7 + 1) - (uint)(cVar3 == '\0');
        if (puVar4 == puVar6) goto LAB_00b20f74;
      }
      puVar6 = (uint *)puVar6[2];
    } while (puVar4 != puVar6);
LAB_00b20f74:
    if (*(int *)(this + 0x584) != 1) {
      return iVar7;
    }
    if (iVar7 != 0) {
      fVar8 = *(float *)(this + 0x570) + *(float *)(this + 0x570);
      *(float *)(this + 0x570) = fVar8;
      if (*(float *)(this + 0x574) < fVar8) {
        *(float *)(this + 0x570) = *(float *)(this + 0x574);
      }
      *(float *)(this + 0x57c) = *(float *)(gpGlobals + 0xc) + 3.0;
      return iVar7;
    }
  }
  if (*(float *)(gpGlobals + 0xc) < *(float *)(this + 0x57c) ||
      *(float *)(gpGlobals + 0xc) == *(float *)(this + 0x57c)) {
    return 0;
  }
  *(undefined4 *)(this + 0x570) = *(undefined4 *)(this + 0x56c);
  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)