L L4D2node

UTIL_ViewPunch

0x00b2bac0 · 326 bytes · __cdecl

_Z14UTIL_ViewPunchRK6Vector6QAnglefb

Decompiled

undefined (4 params)

/* UTIL_ViewPunch(Vector const&, QAngle, float, bool) */

void UTIL_ViewPunch(float *param_1,float param_2,float param_3,float param_4,float param_5,
                   char param_6)

{
  CBaseEntity *this;
  int iVar1;
  float fVar2;
  float local_28;
  float local_24;
  float local_20;
  
  if (0 < *(int *)(gpGlobals + 0x14)) {
    iVar1 = 1;
    do {
      this = (CBaseEntity *)UTIL_PlayerByIndex(iVar1);
      if ((this != (CBaseEntity *)0x0) && ((param_6 != '\0' || (((byte)this[0x150] & 1) != 0)))) {
        local_28 = param_2;
        local_24 = param_3;
        local_20 = param_4;
        if (0.0 < param_5) {
          if (((byte)this[0x14d] & 8) != 0) {
            CBaseEntity::CalcAbsolutePosition(this);
          }
          fVar2 = SQRT((*param_1 - *(float *)(this + 0x2e0)) * (*param_1 - *(float *)(this + 0x2e0))
                       + (param_1[1] - *(float *)(this + 0x2e4)) *
                         (param_1[1] - *(float *)(this + 0x2e4)) +
                       (param_1[2] - *(float *)(this + 0x2e8)) *
                       (param_1[2] - *(float *)(this + 0x2e8)));
          if (param_5 < fVar2) goto LAB_00b2bb9b;
          fVar2 = 1.0 - fVar2 * (1.0 / param_5);
          local_28 = local_28 * fVar2;
          local_20 = fVar2 * local_20;
          local_24 = local_24 * fVar2;
        }
        CBaseEntity::ViewPunch(this,(QAngle *)&local_28);
      }
LAB_00b2bb9b:
      iVar1 = iVar1 + 1;
    } while (iVar1 <= *(int *)(gpGlobals + 0x14));
  }
  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)