L L4D2node

CTerrorGun::Deploy

0x00565130 · 521 bytes · __thiscall

_ZN10CTerrorGun6DeployEv

Decompiled

undefined (1 param)

/* CTerrorGun::Deploy() */

uint __thiscall CTerrorGun::Deploy(CTerrorGun *this)

{
  code *pcVar1;
  CBaseEdict *pCVar2;
  int *piVar3;
  char cVar4;
  CTerrorGun CVar5;
  CTerrorPlayer *this_00;
  uint uVar6;
  undefined4 uVar7;
  undefined4 uVar8;
  int iVar9;
  int iVar10;
  int iVar11;
  
  cVar4 = (**(code **)(*(int *)this + 0x420))(this);
  if (cVar4 != '\0') {
    *(undefined4 *)(this + 0x17f0) = 0;
    this_00 = (CTerrorPlayer *)CTerrorWeapon::GetPlayerOwner((CTerrorWeapon *)this);
    if (this_00 != (CTerrorPlayer *)0x0) {
      if (this[0x17e1] != (CTerrorGun)0x0) {
        CVar5 = (CTerrorGun)CTerrorPlayer::CanDualWield(this_00);
        if (CVar5 != this[0x17e0]) {
          if (this[0x6c] == (CTerrorGun)0x0) {
            pCVar2 = *(CBaseEdict **)(this + 0x30);
            if (pCVar2 != (CBaseEdict *)0x0) {
              *(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
              iVar9 = CBaseEdict::GetChangeAccessor(pCVar2);
              *(undefined2 *)(iVar9 + 2) = 0;
            }
          }
          else {
            this[0x70] = (CTerrorGun)((byte)this[0x70] | 1);
          }
          this[0x17e0] = CVar5;
        }
        iVar9 = *(int *)(this + 0x1420);
        iVar10 = (**(code **)(*(int *)this + 0x510))(this);
        if (iVar10 < iVar9) {
          iVar9 = *(int *)(this + 0x1420);
          iVar10 = iVar9 - iVar9 / 2;
          *(int *)(this + 0x17e8) = iVar9 / 2;
          if (iVar9 != iVar10) {
            if (this[0x6c] == (CTerrorGun)0x0) {
              pCVar2 = *(CBaseEdict **)(this + 0x30);
              if (pCVar2 != (CBaseEdict *)0x0) {
                *(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
                iVar9 = CBaseEdict::GetChangeAccessor(pCVar2);
                *(undefined2 *)(iVar9 + 2) = 0;
              }
            }
            else {
              this[0x70] = (CTerrorGun)((byte)this[0x70] | 1);
            }
            *(int *)(this + 0x1420) = iVar10;
          }
        }
        else {
          iVar9 = *(int *)(this + 0x17e8);
          if ((0 < iVar9) &&
             (iVar10 = *(int *)(this + 0x1420), iVar11 = (**(code **)(*(int *)this + 0x510))(this),
             iVar9 + iVar10 <= iVar11)) {
            iVar9 = *(int *)(this + 0x17e8) + *(int *)(this + 0x1420);
            if (*(int *)(this + 0x1420) != iVar9) {
              if (this[0x6c] == (CTerrorGun)0x0) {
                pCVar2 = *(CBaseEdict **)(this + 0x30);
                if (pCVar2 != (CBaseEdict *)0x0) {
                  *(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
                  iVar10 = CBaseEdict::GetChangeAccessor(pCVar2);
                  *(undefined2 *)(iVar10 + 2) = 0;
                }
              }
              else {
                this[0x70] = (CTerrorGun)((byte)this[0x70] | 1);
              }
              *(int *)(this + 0x1420) = iVar9;
            }
            *(undefined4 *)(this + 0x17e8) = 0;
          }
        }
      }
      uVar6 = CTerrorWeapon::Deploy((CTerrorWeapon *)this);
      if ((char)uVar6 != '\0') {
        CVar5 = this[0x17e2];
        if (CVar5 == (CTerrorGun)0x0) {
          return uVar6;
        }
        if (*(int *)(this + 0x17dc) == 0) {
          pcVar1 = *(code **)(*(int *)this_00 + 0x44c);
          uVar7 = (**(code **)(*(int *)this + 0x55c))(this);
          uVar8 = (**(code **)(*(int *)this + 0x510))(this);
          (*pcVar1)(this_00,uVar8,uVar7,0);
          piVar3 = mdlcache;
          (**(code **)(*mdlcache + 0x68))(mdlcache);
                    /* try { // try from 005651f2 to 005651f7 has its CatchHandler @ 00565350 */
          (**(code **)(*(int *)this + 0x468))(this);
          (**(code **)(*piVar3 + 0x6c))(piVar3);
        }
        return (uint)(byte)CVar5;
      }
    }
  }
  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)