L L4D2node

CBasePlayer::GetAutoaimVector

0x007b2fb0 · 409 bytes · __thiscall

_ZN11CBasePlayer16GetAutoaimVectorER16autoaim_params_t

Decompiled

undefined (2 params)

/* CBasePlayer::GetAutoaimVector(autoaim_params_t&) */

void __thiscall CBasePlayer::GetAutoaimVector(CBasePlayer *this,autoaim_params_t *param_1)

{
  code *pcVar1;
  uint uVar2;
  CBaseEdict *this_00;
  undefined4 uVar3;
  char cVar4;
  float *pfVar5;
  int iVar6;
  undefined *puVar7;
  int *piVar8;
  Vector local_40 [12];
  undefined4 local_34;
  undefined4 local_30;
  undefined4 local_2c;
  float local_28;
  float local_24;
  float local_20;
  
  *(undefined4 *)(param_1 + 0xc) = vec3_invalid;
  uVar3 = DAT_01053d24;
  param_1[0x29] = (autoaim_params_t)0x0;
  *(undefined4 *)(param_1 + 0x10) = uVar3;
  uVar3 = DAT_01053d28;
  param_1[0x2a] = (autoaim_params_t)0x0;
  *(undefined4 *)(param_1 + 0x18) = 0xffffffff;
  *(undefined4 *)(param_1 + 0x14) = uVar3;
  cVar4 = (**(code **)(*(int *)this + 0x710))();
  piVar8 = (int *)&stack0xffffffa4;
  if ((cVar4 != '\0') && (piVar8 = (int *)&stack0xffffffa4, *(float *)(param_1 + 0x1c) != 0.0)) {
    (**(code **)(*(int *)this + 0x478))();
    AutoaimDeflection(local_40,(autoaim_params_t *)this);
    cVar4 = (**(code **)(*g_pGameRules + 0x128))();
    if ((cVar4 == '\0') && (this[0x1cc8] != (CBasePlayer)0x0)) {
      if (this[0x6c] == (CBasePlayer)0x0) {
        this_00 = *(CBaseEdict **)(this + 0x30);
        if (this_00 != (CBaseEdict *)0x0) {
          *(uint *)this_00 = *(uint *)this_00 | 0x101;
          iVar6 = CBaseEdict::GetChangeAccessor(this_00);
          *(undefined2 *)(iVar6 + 2) = 0;
        }
      }
      else {
        this[0x70] = (CBasePlayer)((byte)this[0x70] | 1);
      }
      this[0x1cc8] = (CBasePlayer)0x0;
    }
    uVar2 = *(uint *)(param_1 + 0x18);
    piVar8 = (int *)&stack0xffffffa0;
    if ((((uVar2 != 0xffffffff) &&
         (puVar7 = g_pEntityList + (uVar2 & 0xfff) * 0x10, piVar8 = (int *)&stack0xffffffa0,
         puVar7 != (undefined *)0xfffffffc)) &&
        (piVar8 = (int *)&stack0xffffffa0, *(uint *)(puVar7 + 8) == uVar2 >> 0xc)) &&
       (piVar8 = (int *)&stack0xffffffa0, *(int *)(puVar7 + 4) != 0)) {
      return;
    }
  }
  iVar6 = *(int *)this;
  *piVar8 = (int)this;
  pcVar1 = *(code **)(iVar6 + 0x238);
  piVar8[-1] = 0x7b3018;
  pfVar5 = (float *)(*pcVar1)();
  local_28 = *(float *)(this + 0x1ab0) + *pfVar5;
  local_24 = *(float *)(this + 0x1ab4) + pfVar5[1];
  local_20 = *(float *)(this + 0x1ab8) + pfVar5[2];
  piVar8[1] = (int)&local_34;
  *piVar8 = (int)&local_28;
  piVar8[-1] = 0x7b305f;
  AngleVectors((QAngle *)*piVar8,(Vector *)piVar8[1]);
  *(undefined4 *)param_1 = local_34;
  *(undefined4 *)(param_1 + 4) = local_30;
  *(undefined4 *)(param_1 + 8) = local_2c;
  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)