L L4D2node

CPlayerMove::SetupMove

0x007c6f20 · 1337 bytes · __thiscall

_ZN11CPlayerMove9SetupMoveEP11CBasePlayerP8CUserCmdP11IMoveHelperP9CMoveData

Decompiled

undefined (5 params)

/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* CPlayerMove::SetupMove(CBasePlayer*, CUserCmd*, IMoveHelper*, CMoveData*) */

void __thiscall
CPlayerMove::SetupMove
          (CPlayerMove *this,CBasePlayer *param_1,CUserCmd *param_2,IMoveHelper *param_3,
          CMoveData *param_4)

{
  undefined4 uVar1;
  undefined4 uVar2;
  undefined4 uVar3;
  uint uVar4;
  CBaseEntity *pCVar5;
  int iVar6;
  char cVar7;
  float *pfVar8;
  undefined4 *puVar9;
  int iVar10;
  undefined *puVar11;
  undefined4 local_94;
  undefined4 local_90;
  undefined4 local_88;
  undefined4 local_84;
  int local_80;
  matrix3x4_t local_7c [48];
  matrix3x4_t local_4c [60];
  
  local_94 = 0;
  local_90 = 0;
  if (___atan2f_finite == 0) {
    local_80 = 0;
  }
  else {
    (**(code **)(___atan2f_finite + 0x50))
              (___atan2f_finite,&local_94,0,0,0,0,"/data/src/game/server/player_command.cpp",0x84,
               &SetupMove(CBasePlayer*,CUserCmd*,IMoveHelper*,CMoveData*)::tm_fmt,"(%s)%s",
               "Unaccounted","CPlayerMove::SetupMove");
    local_80 = ___atan2f_finite;
  }
  iVar6 = _DAT_0105db00;
  local_88 = local_94;
  local_84 = local_90;
                    /* try { // try from 007c7293 to 007c72e5 has its CatchHandler @ 007c748a */
  if (((_DAT_0105d154 != 0) || (DAT_0105d158 == '\0')) &&
     (iVar10 = ThreadGetCurrentId(), iVar6 == iVar10)) {
    if ((char *)*_DAT_0105d15c != "CPlayerMove::SetupMove") {
      _DAT_0105d15c =
           (int *)CVProfNode::GetSubNode((char *)_DAT_0105d15c,0xcbc46a,(char *)0x1,0xbfafa1);
    }
    CVProfNode::EnterScope();
    DAT_0105d158 = '\0';
  }
  *param_4 = (CMoveData)((byte)*param_4 & 0xfd | 1);
  if (((byte)param_1[0x14d] & 8) != 0) {
                    /* try { // try from 007c7006 to 007c721d has its CatchHandler @ 007c74a2 */
    CBaseEntity::CalcAbsolutePosition((CBaseEntity *)param_1);
  }
  pfVar8 = (float *)CBasePlayer::GetPreviouslyPredictedOrigin(param_1);
  if (((*(float *)(param_1 + 0x2e0) != *pfVar8) || (*(float *)(param_1 + 0x2e4) != pfVar8[1])) ||
     (*(float *)(param_1 + 0x2e8) != pfVar8[2])) {
    *param_4 = (CMoveData)((byte)*param_4 | 2);
  }
  puVar11 = g_pEntityList;
  *(uint *)(param_4 + 8) = (uint)(byte)param_2[0x28];
  uVar1 = *(undefined4 *)(param_2 + 0xc);
  *(undefined4 *)(param_4 + 0xc) = uVar1;
  uVar2 = *(undefined4 *)(param_2 + 0x10);
  *(undefined4 *)(param_4 + 0x10) = uVar2;
  uVar3 = *(undefined4 *)(param_2 + 0x14);
  *(undefined4 *)(param_4 + 0x14) = uVar3;
  uVar4 = *(uint *)(param_1 + 0x188);
  if (((uVar4 == 0xffffffff) ||
      (puVar11 = puVar11 + (uVar4 & 0xfff) * 0x10, puVar11 == (undefined *)0xfffffffc)) ||
     ((*(uint *)(puVar11 + 8) != uVar4 >> 0xc ||
      (pCVar5 = *(CBaseEntity **)(puVar11 + 4), pCVar5 == (CBaseEntity *)0x0)))) {
    *(undefined4 *)(param_4 + 0x18) = uVar1;
    *(undefined4 *)(param_4 + 0x1c) = uVar2;
    *(undefined4 *)(param_4 + 0x20) = uVar3;
  }
  else {
    AngleMatrix((QAngle *)(param_4 + 0xc),local_7c);
    if (((byte)pCVar5[0x14d] & 8) != 0) {
      CBaseEntity::CalcAbsolutePosition(pCVar5);
    }
    ConcatTransforms((matrix3x4_t *)(pCVar5 + 0x28c),local_7c,local_4c);
    MatrixAngles(local_4c,(float *)(param_4 + 0x18));
  }
  *(undefined4 *)(param_4 + 0x24) = *(undefined4 *)(param_2 + 0x24);
  if (((byte)param_1[0x150] & 0x40) == 0) {
    *(undefined4 *)(param_4 + 0x2c) = *(undefined4 *)(param_2 + 0x18);
    *(undefined4 *)(param_4 + 0x30) = *(undefined4 *)(param_2 + 0x1c);
    *(undefined4 *)(param_4 + 0x34) = *(undefined4 *)(param_2 + 0x20);
  }
  else {
    *(undefined4 *)(param_4 + 0x2c) = 0;
    *(undefined4 *)(param_4 + 0x30) = 0;
    *(undefined4 *)(param_4 + 0x34) = 0;
  }
  *(undefined4 *)(param_4 + 0x3c) = *(undefined4 *)(param_1 + 0x1ff8);
  *(undefined4 *)(param_4 + 0x28) = *(undefined4 *)(param_1 + 0x1aa8);
  *(undefined4 *)(param_4 + 0x4c) = *(undefined4 *)(param_1 + 0x1c84);
  *(undefined4 *)(param_4 + 0x50) = *(undefined4 *)(param_1 + 0x1c88);
  *(undefined4 *)(param_4 + 0x54) = *(undefined4 *)(param_1 + 0x1c8c);
  if (((byte)param_1[0x14d] & 0x10) != 0) {
                    /* try { // try from 007c7363 to 007c73f2 has its CatchHandler @ 007c74a2 */
    CBaseEntity::CalcAbsoluteVelocity((CBaseEntity *)param_1);
  }
  *(undefined4 *)(param_4 + 0x40) = *(undefined4 *)(param_1 + 0x274);
  *(undefined4 *)(param_4 + 0x44) = *(undefined4 *)(param_1 + 0x278);
  *(undefined4 *)(param_4 + 0x48) = *(undefined4 *)(param_1 + 0x27c);
  puVar9 = (undefined4 *)(**(code **)(*(int *)param_1 + 0xc))(param_1);
  *(undefined4 *)(param_4 + 4) = *puVar9;
  if (((byte)param_1[0x14d] & 8) != 0) {
    CBaseEntity::CalcAbsolutePosition((CBaseEntity *)param_1);
  }
  puVar11 = g_pEntityList;
  *(undefined4 *)(param_4 + 0x9c) = *(undefined4 *)(param_1 + 0x2e0);
  *(undefined4 *)(param_4 + 0xa0) = *(undefined4 *)(param_1 + 0x2e4);
  *(undefined4 *)(param_4 + 0xa4) = *(undefined4 *)(param_1 + 0x2e8);
  uVar4 = *(uint *)(param_1 + 0x208c);
  if ((((uVar4 == 0xffffffff) ||
       (puVar11 = puVar11 + (uVar4 & 0xfff) * 0x10, puVar11 == (undefined *)0xfffffffc)) ||
      (*(uint *)(puVar11 + 8) != uVar4 >> 0xc)) ||
     (pCVar5 = *(CBaseEntity **)(puVar11 + 4), pCVar5 == (CBaseEntity *)0x0)) {
    *(undefined4 *)(param_4 + 0x80) = *(undefined4 *)(param_1 + 0x2090);
    *(undefined4 *)(param_4 + 0x84) = *(undefined4 *)(param_1 + 0x2094);
    *(undefined4 *)(param_4 + 0x88) = *(undefined4 *)(param_1 + 0x2098);
  }
  else {
    if (((byte)pCVar5[0x14d] & 8) != 0) {
                    /* try { // try from 007c7483 to 007c7487 has its CatchHandler @ 007c74a2 */
      CBaseEntity::CalcAbsolutePosition(pCVar5);
    }
    *(undefined4 *)(param_4 + 0x80) = *(undefined4 *)(pCVar5 + 0x2e0);
    *(undefined4 *)(param_4 + 0x84) = *(undefined4 *)(pCVar5 + 0x2e4);
    *(undefined4 *)(param_4 + 0x88) = *(undefined4 *)(pCVar5 + 0x2e8);
  }
  *(undefined4 *)(param_4 + 0x8c) = *(undefined4 *)(param_1 + 0x209c);
  *(undefined4 *)(param_4 + 0x90) = *(undefined4 *)(param_1 + 0x20a0);
  *(undefined4 *)(param_4 + 0x94) = *(undefined4 *)(param_1 + 0x20a4);
  *(CBasePlayer *)(param_4 + 0x98) = param_1[0x20a8];
  (**(code **)(*(int *)g_pGameMovement + 0x34))(g_pGameMovement,param_4);
  iVar6 = _DAT_0105db00;
  if (((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) &&
     (iVar10 = ThreadGetCurrentId(), iVar6 == iVar10)) {
    cVar7 = CVProfNode::ExitScope();
    if (cVar7 != '\0') {
      _DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
    }
    DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
  }
  if (local_80 != 0) {
    (**(code **)(local_80 + 0x54))(local_80,local_88,local_84,0,0,0);
  }
  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)