L L4D2node

CPropMinigun::AngleThink

0x00548de0 · 724 bytes · __thiscall

_ZN12CPropMinigun10AngleThinkEv

Decompiled

undefined (1 param)

/* CPropMinigun::AngleThink() */

void __thiscall CPropMinigun::AngleThink(CPropMinigun *this)

{
  uint uVar1;
  CBaseEntity *this_00;
  CBaseEdict *pCVar2;
  CPropMinigun CVar3;
  int iVar4;
  undefined *puVar5;
  longdouble lVar6;
  float fVar7;
  float fVar8;
  float fVar9;
  
  CBaseEntity::SetNextThink((CBaseEntity *)this,*(float *)(gpGlobals + 0xc) + 0.1,(char *)0x0);
  fVar7 = *(float *)(gpGlobals + 0xc) - *(float *)(this + 0x160c);
  *(float *)(this + 0x160c) = *(float *)(gpGlobals + 0xc);
  UpdateBarrelMovement(this,fVar7);
  UpdateHeat(this,fVar7);
  uVar1 = *(uint *)(this + 0x180);
  if ((((uVar1 != 0xffffffff) &&
       (puVar5 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar5 != (undefined *)0xfffffffc)) &&
      (*(uint *)(puVar5 + 8) == uVar1 >> 0xc)) &&
     (this_00 = *(CBaseEntity **)(puVar5 + 4), this_00 != (CBaseEntity *)0x0)) {
    if (((byte)this_00[0x14d] & 8) != 0) {
      CBaseEntity::CalcAbsolutePosition(this_00);
    }
    fVar9 = *(float *)(this_00 + 0x37c) - *(float *)(this + 0x15f0);
    fVar7 = *(float *)(this_00 + 900) - *(float *)(this + 0x15f8);
    fVar8 = *(float *)(this_00 + 0x380) - *(float *)(this + 0x15f4);
    if (0.01 <= SQRT(fVar7 * fVar7 + fVar9 * fVar9 + fVar8 * fVar8)) {
      fVar9 = fVar9 + *(float *)(this + 0x15e4);
      fVar8 = fVar8 + *(float *)(this + 0x15e8);
      fVar7 = fVar7 + *(float *)(this + 0x15ec);
      if (((*(float *)(this + 0x15e4) == fVar9) && (*(float *)(this + 0x15e8) == fVar8)) &&
         (*(float *)(this + 0x15ec) == fVar7)) {
        CVar3 = this[0x6c];
      }
      else {
        if (this[0x6c] == (CPropMinigun)0x0) {
          pCVar2 = *(CBaseEdict **)(this + 0x30);
          CVar3 = (CPropMinigun)0x0;
          if (pCVar2 != (CBaseEdict *)0x0) {
            *(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
            iVar4 = CBaseEdict::GetChangeAccessor(pCVar2);
            *(undefined2 *)(iVar4 + 2) = 0;
            CVar3 = this[0x6c];
          }
        }
        else {
          this[0x70] = (CPropMinigun)((byte)this[0x70] | 1);
          CVar3 = (CPropMinigun)0x1;
        }
        *(float *)(this + 0x15e4) = fVar9;
        *(float *)(this + 0x15e8) = fVar8;
        *(float *)(this + 0x15ec) = fVar7;
      }
      if (CVar3 == (CPropMinigun)0x0) {
        pCVar2 = *(CBaseEdict **)(this + 0x30);
        if (pCVar2 != (CBaseEdict *)0x0) {
          *(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
          iVar4 = CBaseEdict::GetChangeAccessor(pCVar2);
          *(undefined2 *)(iVar4 + 2) = 0;
        }
      }
      else {
        this[0x70] = (CPropMinigun)((byte)this[0x70] | 1);
      }
      lVar6 = (longdouble)AngleNormalize(*(float *)(this + 0x15e8));
      *(float *)(this + 0x15e8) = (float)lVar6;
      if (this[0x6c] == (CPropMinigun)0x0) {
        pCVar2 = *(CBaseEdict **)(this + 0x30);
        if (pCVar2 != (CBaseEdict *)0x0) {
          *(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
          iVar4 = CBaseEdict::GetChangeAccessor(pCVar2);
          *(undefined2 *)(iVar4 + 2) = 0;
        }
      }
      else {
        this[0x70] = (CPropMinigun)((byte)this[0x70] | 1);
      }
      lVar6 = (longdouble)AngleNormalize(*(float *)(this + 0x15e4));
      *(float *)(this + 0x15e4) = (float)lVar6;
      if (((byte)this_00[0x14d] & 8) != 0) {
        CBaseEntity::CalcAbsolutePosition(this_00);
      }
      *(undefined4 *)(this + 0x15f0) = *(undefined4 *)(this_00 + 0x37c);
      *(undefined4 *)(this + 0x15f4) = *(undefined4 *)(this_00 + 0x380);
      *(undefined4 *)(this + 0x15f8) = *(undefined4 *)(this_00 + 900);
      return;
    }
  }
  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)