L L4D2node

UTIL_ScreenShakeObject

0x00b2b550 · 581 bytes · __cdecl

_Z22UTIL_ScreenShakeObjectP11CBaseEntityRK6Vectorffff14ShakeCommand_tb

Decompiled

undefined (8 params)

/* UTIL_ScreenShakeObject(CBaseEntity*, Vector const&, float, float, float, float, ShakeCommand_t,
   bool) */

void UTIL_ScreenShakeObject
               (CBaseEntity *param_1,float *param_2,float param_3,float param_4,float param_5,
               float param_6,int param_7,char param_8)

{
  int iVar1;
  CBaseEntity *this;
  int iVar2;
  float *pfVar3;
  CBaseEntity *this_00;
  int iVar4;
  float fVar5;
  float local_40;
  undefined **local_3c [11];
  
  iVar1 = CBaseEntity::GetRootMoveParent(param_1);
  if (*(int *)(gpGlobals + 0x14) < 1) {
    return;
  }
  iVar4 = 1;
  do {
    while (this = (CBaseEntity *)UTIL_PlayerByIndex(iVar4), this == (CBaseEntity *)0x0) {
LAB_00b2b670:
      iVar4 = iVar4 + 1;
      if (*(int *)(gpGlobals + 0x14) < iVar4) {
        return;
      }
    }
    iVar2 = CBaseEntity::GetRootMoveParent(this);
    if (iVar1 != iVar2) {
      if ((((byte)this[0x150] & 1) != 0) && (iVar2 = CBaseEntity::GetGroundEntity(this), iVar2 != 0)
         ) {
        this_00 = (CBaseEntity *)CBaseEntity::GetGroundEntity(this);
        iVar2 = CBaseEntity::GetRootMoveParent(this_00);
        if (iVar1 == iVar2) goto LAB_00b2b6b9;
      }
      if ((param_8 != '\0') || (((byte)this[0x150] & 1) != 0)) {
        pfVar3 = (float *)(**(code **)(*(int *)this + 0x288))(this);
        if (param_6 <= 0.0) {
          local_40 = param_3;
        }
        else {
          fVar5 = SQRT((param_2[1] - pfVar3[1]) * (param_2[1] - pfVar3[1]) +
                       (*param_2 - *pfVar3) * (*param_2 - *pfVar3) +
                       (param_2[2] - pfVar3[2]) * (param_2[2] - pfVar3[2]));
          if (param_6 < fVar5) goto LAB_00b2b670;
          local_40 = (1.0 - fVar5 * (1.0 / param_6)) * param_3;
        }
        if (0.0 <= local_40) goto LAB_00b2b6c6;
      }
      goto LAB_00b2b670;
    }
LAB_00b2b6b9:
    local_40 = param_3;
LAB_00b2b6c6:
    if (local_40 <= 0.0) {
      if (param_7 == 1) goto LAB_00b2b788;
      goto LAB_00b2b670;
    }
    if (param_7 == 1) {
LAB_00b2b788:
      local_40 = 0.0;
    }
    CRecipientFilter::CRecipientFilter((CRecipientFilter *)local_3c);
    local_3c[0] = &PTR__CSingleUserRecipientFilter_00c08ea8;
                    /* try { // try from 00b2b6f9 to 00b2b6fd has its CatchHandler @ 00b2b7c0 */
    CRecipientFilter::AddRecipient((CRecipientFilter *)local_3c,(CBasePlayer *)this);
                    /* try { // try from 00b2b701 to 00b2b752 has its CatchHandler @ 00b2b7a7 */
    CRecipientFilter::MakeReliable((CRecipientFilter *)local_3c);
    UserMessageBegin((IRecipientFilter *)local_3c,"Shake");
    MessageWriteByte(param_7);
    MessageWriteFloat(local_40);
    MessageWriteFloat(param_4);
    MessageWriteFloat(param_5);
    MessageEnd();
    iVar4 = iVar4 + 1;
    local_3c[0] = &PTR__CSingleUserRecipientFilter_00c08ea8;
    CRecipientFilter::~CRecipientFilter((CRecipientFilter *)local_3c);
    if (*(int *)(gpGlobals + 0x14) < iVar4) {
      return;
    }
  } while( true );
}

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)