L L4D2node

CPointCommentaryNode::UpdateViewPostThink

0x0064a540 · 800 bytes · __thiscall

_ZN20CPointCommentaryNode19UpdateViewPostThinkEv

Decompiled

undefined (1 param)

/* CPointCommentaryNode::UpdateViewPostThink() */

void __thiscall CPointCommentaryNode::UpdateViewPostThink(CPointCommentaryNode *this)

{
  float fVar1;
  float fVar2;
  float fVar3;
  uint uVar4;
  CBasePlayer *this_00;
  CBaseEntity *pCVar5;
  undefined *puVar6;
  float fVar7;
  float local_70;
  float local_6c;
  float local_68;
  float local_64;
  float local_60;
  float local_5c;
  QAngle local_58 [12];
  Quaternion local_4c [16];
  Quaternion local_3c [16];
  float local_2c;
  float local_28;
  float local_24;
  
  this_00 = (CBasePlayer *)GetCommentaryPlayer();
  if (this_00 != (CBasePlayer *)0x0) {
    uVar4 = *(uint *)(this + 0x1414);
    if (((((uVar4 != 0xffffffff) &&
          (puVar6 = g_pEntityList + (uVar4 & 0xfff) * 0x10, puVar6 != (undefined *)0xfffffffc)) &&
         (*(uint *)(puVar6 + 8) == uVar4 >> 0xc)) &&
        ((*(int *)(puVar6 + 4) != 0 && (uVar4 = *(uint *)(this + 0x1418), uVar4 != 0xffffffff)))) &&
       ((puVar6 = g_pEntityList + (uVar4 & 0xfff) * 0x10, puVar6 != (undefined *)0xfffffffc &&
        ((*(uint *)(puVar6 + 8) == uVar4 >> 0xc &&
         (pCVar5 = *(CBaseEntity **)(puVar6 + 4), pCVar5 != (CBaseEntity *)0x0)))))) {
      fVar7 = *(float *)(this + 0x1420) - *(float *)(this + 0x148c);
      if (2.0 <= fVar7) {
        fVar7 = 2.0;
      }
      fVar7 = (*(float *)(gpGlobals + 0xc) - *(float *)(this + 0x1420)) / fVar7;
      if (fVar7 <= 1.0) {
        if (fVar7 <= 0.0) {
          fVar7 = 0.0;
        }
        fVar7 = 1.0 - fVar7;
        if (0.0 < fVar7) {
          (**(code **)(*(int *)this_00 + 0x234))(&local_70,this_00);
          fVar1 = *(float *)(this + 0x1424);
          fVar2 = *(float *)(this + 0x1428);
          fVar3 = *(float *)(this + 0x142c);
          (**(code **)(*(int *)this_00 + 0x234))((Quaternion *)&local_2c,this_00);
          pCVar5 = (CBaseEntity *)0x0;
          uVar4 = *(uint *)(this + 0x1418);
          local_64 = (fVar1 - local_70) * fVar7 + local_2c;
          local_60 = (fVar2 - local_6c) * fVar7 + local_28;
          local_5c = (fVar3 - local_68) * fVar7 + local_24;
          if (((uVar4 != 0xffffffff) &&
              (puVar6 = g_pEntityList + (uVar4 & 0xfff) * 0x10, puVar6 != (undefined *)0xfffffffc))
             && (*(uint *)(puVar6 + 8) == uVar4 >> 0xc)) {
            pCVar5 = *(CBaseEntity **)(puVar6 + 4);
          }
          CBaseEntity::SetAbsOrigin(pCVar5,(Vector *)&local_64);
          uVar4 = *(uint *)(this + 0x1408);
          if (((uVar4 != 0xffffffff) &&
              (puVar6 = g_pEntityList + (uVar4 & 0xfff) * 0x10, puVar6 != (undefined *)0xfffffffc))
             && ((*(uint *)(puVar6 + 8) == uVar4 >> 0xc && (*(int *)(puVar6 + 4) != 0)))) {
            AngleQuaternion((QAngle *)(this + 0x1430),local_3c);
            AngleQuaternion((QAngle *)(this + 0x143c),local_4c);
            QuaternionSlerp(local_4c,local_3c,1.0 - fVar7,(Quaternion *)&local_2c);
            QuaternionAngles((Quaternion *)&local_2c,local_58);
            uVar4 = *(uint *)(this + 0x1418);
            pCVar5 = (CBaseEntity *)0x0;
            if (((uVar4 != 0xffffffff) &&
                (puVar6 = g_pEntityList + (uVar4 & 0xfff) * 0x10, puVar6 != (undefined *)0xfffffffc)
                ) && (*(uint *)(puVar6 + 8) == uVar4 >> 0xc)) {
              pCVar5 = *(CBaseEntity **)(puVar6 + 4);
            }
            CBaseEntity::SetAbsAngles(pCVar5,local_58);
          }
          CBaseEntity::SetNextThink
                    ((CBaseEntity *)this,*(float *)(gpGlobals + 0xc),"CommentaryUpdateViewThink");
          return;
        }
      }
      if (((byte)pCVar5[0x14d] & 8) != 0) {
        CBaseEntity::CalcAbsolutePosition(pCVar5);
      }
      CBasePlayer::SnapEyeAngles(this_00,(QAngle *)(pCVar5 + 0x37c));
    }
    CleanupPostCommentary(this);
    this[0x1448] = (CPointCommentaryNode)0x0;
  }
  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)