L L4D2node

CTankClaw::PrimaryAttack

0x0055d9b0 · 584 bytes · __thiscall

_ZN9CTankClaw13PrimaryAttackEv

Decompiled

undefined (1 param)

/* CTankClaw::PrimaryAttack() */

void __thiscall CTankClaw::PrimaryAttack(CTankClaw *this)

{
  uint uVar1;
  code *pcVar2;
  byte *pbVar3;
  char cVar4;
  int *piVar5;
  int *piVar6;
  undefined4 uVar7;
  int iVar8;
  undefined *puVar9;
  int *piVar10;
  byte *pbVar11;
  byte *pbVar12;
  bool bVar13;
  bool bVar14;
  byte bVar15;
  longdouble lVar16;
  byte *local_20;
  
  bVar15 = 0;
  if (*(int *)(HulkAutoSwing._28_4_ + 0x30) != 0) {
    return;
  }
  piVar5 = (int *)CTerrorWeapon::GetPlayerOwner((CTerrorWeapon *)this);
  if (piVar5 != (int *)0x0) {
    uVar1 = piVar5[0xc2f];
    if (((uVar1 == 0xffffffff) ||
        (puVar9 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar9 == (undefined *)0xfffffffc)) ||
       (*(uint *)(puVar9 + 8) != uVar1 >> 0xc)) {
      piVar10 = (int *)0x0;
    }
    else {
      piVar10 = *(int **)(puVar9 + 4);
      if ((piVar10 != (int *)0x0) &&
         (cVar4 = (**(code **)(*piVar10 + 0x354))(piVar10), cVar4 != '\0')) {
        return;
      }
    }
    cVar4 = (**(code **)(*piVar5 + 0x840))(piVar5);
    if (cVar4 != '\0') {
      piVar6 = (int *)(**(code **)(*gameeventmanager + 0x1c))(gameeventmanager,"weapon_fire",0,0);
      if (piVar6 != (int *)0x0) {
        pcVar2 = *(code **)(*piVar6 + 0x30);
        uVar7 = (**(code **)(*engine + 0x40))(engine,piVar5[0xc]);
        (*pcVar2)(piVar6,"userid",uVar7);
        pbVar3 = *(byte **)(this + 0x7c);
        bVar13 = false;
        if (pbVar3 == (byte *)0x0) {
          local_20 = &DAT_00d539c2;
        }
        else {
          iVar8 = 7;
          bVar14 = false;
          pbVar11 = pbVar3;
          pbVar12 = (byte *)"weapon_";
          do {
            if (iVar8 == 0) break;
            iVar8 = iVar8 + -1;
            bVar13 = *pbVar11 < *pbVar12;
            bVar14 = *pbVar11 == *pbVar12;
            pbVar11 = pbVar11 + (uint)bVar15 * -2 + 1;
            pbVar12 = pbVar12 + (uint)bVar15 * -2 + 1;
          } while (bVar14);
          local_20 = pbVar3 + 7;
          if ((!bVar13 && !bVar14) != bVar13) {
            local_20 = pbVar3;
          }
        }
        (**(code **)(*piVar6 + 0x3c))(piVar6,"weapon",local_20);
        pcVar2 = *(code **)(*piVar6 + 0x30);
        uVar7 = (**(code **)(*(int *)this + 0x638))(this);
        (*pcVar2)(piVar6,"weaponid",uVar7);
        (**(code **)(*gameeventmanager + 0x20))(gameeventmanager,piVar6,0);
      }
      iVar8 = CTerrorWeapon::GetAttackTimer((CTerrorWeapon *)this);
      lVar16 = (longdouble)CountdownTimer::Now();
      if ((*(float *)(iVar8 + 8) <= (float)lVar16) &&
         ((**(code **)(*(int *)this + 0x70c))
                    (this,*(undefined4 *)(HulkSwingInterval._28_4_ + 0x2c),
                     *(undefined4 *)(HulkSwingDuration._28_4_ + 0x2c),
                     *(undefined4 *)(HulkSwingRange._28_4_ + 0x2c),0), piVar10 != (int *)0x0)) {
        (**(code **)(*piVar10 + 0x340))(piVar10,*(undefined4 *)(HulkSwingInterval._28_4_ + 0x2c));
      }
    }
  }
  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)