L L4D2node

CTankClaw::TrySwing

0x0055dc10 · 637 bytes · __thiscall

_ZN9CTankClaw8TrySwingEfffP11CBaseEntity

Decompiled

undefined (5 params)

/* CTankClaw::TrySwing(float, float, float, CBaseEntity*) */

void __thiscall
CTankClaw::TrySwing(CTankClaw *this,float param_1,float param_2,float param_3,CBaseEntity *param_4)

{
  CTankClaw *pCVar1;
  float fVar2;
  code *pcVar3;
  uint *puVar4;
  char cVar5;
  int iVar6;
  float *pfVar7;
  int iVar8;
  undefined4 *puVar9;
  int *piVar10;
  longdouble lVar11;
  float fVar12;
  float fVar13;
  float local_34;
  float local_30;
  float local_2c;
  float local_28;
  float local_24;
  float local_20;
  
  piVar10 = (int *)&stack0xffffffa4;
  iVar6 = CTerrorWeapon::GetPlayerOwner((CTerrorWeapon *)this);
  if (iVar6 != 0) {
    cVar5 = (**(code **)(*(int *)this + 0x610))();
    if (cVar5 == '\0') {
      if (param_4 == (CBaseEntity *)0x0) {
        puVar9 = (undefined4 *)(**(code **)(*(int *)this + 0x238))();
        *(undefined4 *)(this + 0x17ec) = *puVar9;
      }
      else {
        (**(code **)(*(int *)this + 0x474))();
        piVar10 = (int *)&stack0xffffffa0;
        pfVar7 = (float *)(**(code **)(*(int *)param_4 + 0x288))();
        local_34 = *pfVar7 - local_28;
        local_30 = pfVar7[1] - local_24;
        local_2c = pfVar7[2] - local_20;
        VectorNormalize((Vector *)&local_34);
        VectorAngles((Vector *)&local_34,(QAngle *)&local_28);
        *(float *)(this + 0x17ec) = local_28;
      }
      fVar2 = *(float *)(HulkWindupTime._28_4_ + 0x2c);
      *(float *)(this + 0x17e8) = param_2;
      *piVar10 = (int)this;
      piVar10[1] = (int)(param_1 + fVar2);
      piVar10[-1] = 0x55dcf7;
      CTerrorWeapon::StartAttackTimer((CTerrorWeapon *)*piVar10,(float)piVar10[1]);
      fVar12 = fVar2 + *(float *)(gpGlobals + 0xc) + param_1;
      fVar13 = *(float *)(this + 0x1400);
      if (fVar12 != *(float *)(this + 0x1400)) {
        if (this[0x6c] == (CTankClaw)0x0) {
          puVar4 = *(uint **)(this + 0x30);
          if (puVar4 != (uint *)0x0) {
            *puVar4 = *puVar4 | 0x101;
            *piVar10 = (int)puVar4;
            piVar10[-1] = 0x55de50;
            iVar8 = CBaseEdict::GetChangeAccessor((CBaseEdict *)*piVar10);
            *(undefined2 *)(iVar8 + 2) = 0;
          }
        }
        else {
          this[0x70] = (CTankClaw)((byte)this[0x70] | 1);
        }
        *(float *)(this + 0x1400) = fVar12;
        fVar13 = fVar12;
      }
      if (fVar13 != *(float *)(this + 0x13fc)) {
        if (this[0x6c] == (CTankClaw)0x0) {
          puVar4 = *(uint **)(this + 0x30);
          if (puVar4 != (uint *)0x0) {
            *puVar4 = *puVar4 | 0x101;
            *piVar10 = (int)puVar4;
            piVar10[-1] = 0x55de14;
            iVar8 = CBaseEdict::GetChangeAccessor((CBaseEdict *)*piVar10);
            *(undefined2 *)(iVar8 + 2) = 0;
          }
        }
        else {
          this[0x70] = (CTankClaw)((byte)this[0x70] | 1);
        }
        *(float *)(this + 0x13fc) = fVar13;
      }
      pCVar1 = this + 0x17dc;
      *(float *)(this + 0x157c) = param_3;
      *piVar10 = (int)pCVar1;
      piVar10[-1] = 0x55dd44;
      lVar11 = (longdouble)CountdownTimer::Now();
      if ((float)lVar11 + fVar2 != *(float *)(this + 0x17e4)) {
        iVar8 = *(int *)(this + 0x17dc);
        piVar10[1] = (int)(this + 0x17e4);
        *piVar10 = (int)pCVar1;
        pcVar3 = *(code **)(iVar8 + 4);
        piVar10[-1] = 0x55dddb;
        (*pcVar3)();
        *(float *)(this + 0x17e4) = (float)lVar11 + fVar2;
      }
      if (fVar2 != *(float *)(this + 0x17e0)) {
        iVar8 = *(int *)(this + 0x17dc);
        *piVar10 = (int)pCVar1;
        piVar10[1] = (int)(this + 0x17e0);
        pcVar3 = *(code **)(iVar8 + 4);
        piVar10[-1] = 0x55dd7e;
        (*pcVar3)();
        *(float *)(this + 0x17e0) = fVar2;
      }
      piVar10[3] = 0;
      piVar10[2] = 0;
      piVar10[1] = (int)"HulkZombie.Attack";
      *piVar10 = iVar6;
      piVar10[-1] = 0x55ddab;
      CBaseEntity::EmitSound
                ((CBaseEntity *)*piVar10,(char *)piVar10[1],(float)piVar10[2],(float *)piVar10[3]);
      iVar6 = *(int *)this;
      *piVar10 = (int)this;
      pcVar3 = *(code **)(iVar6 + 0x6dc);
      piVar10[-1] = 0x55ddb6;
      (*pcVar3)();
    }
  }
  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)