L L4D2node

CBasePlayer::PostThinkVPhysics

0x007b5160 · 1197 bytes · __thiscall

_ZN11CBasePlayer17PostThinkVPhysicsEv

Decompiled

undefined (1 param)

/* CBasePlayer::PostThinkVPhysics() */

void __thiscall CBasePlayer::PostThinkVPhysics(CBasePlayer *this)

{
  float fVar1;
  float fVar2;
  float fVar3;
  float fVar4;
  float fVar5;
  float fVar6;
  uint uVar7;
  int *piVar8;
  code *pcVar9;
  int iVar10;
  undefined *puVar11;
  uint uVar12;
  float fVar13;
  float local_98;
  float local_94;
  float local_90;
  undefined4 local_88;
  undefined4 local_84;
  float local_80;
  undefined4 local_7c;
  undefined4 local_78;
  float local_74;
  CGameTrace local_70 [20];
  float local_5c;
  float local_44;
  char local_3a;
  char local_39;
  
  if (*(int *)(this + 0x1dd4) != 0) {
    if (((byte)this[0x14d] & 8) != 0) {
      CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
    }
    local_94 = *(float *)(this + 0x2e0);
    local_98 = *(float *)(this + 0x2e4);
    local_90 = *(float *)(this + 0x2e8);
    fVar13 = *(float *)(gpGlobals + 0x10);
    if ((0.1 < fVar13) || (fVar13 <= 0.0)) {
      fVar13 = 0.1;
    }
    iVar10 = GetGroundVPhysics(this);
    if ((((iVar10 == 0) && (this[0x1df8] != (CBasePlayer)0x0)) &&
        (*(float *)(g_pMoveData + 100) <= 0.0)) && (((byte)this[0x150] & 1) != 0)) {
      fVar1 = *(float *)(g_pMoveData + 0x68);
      fVar2 = *(float *)(g_pMoveData + 0x6c);
      fVar3 = *(float *)(g_pMoveData + 0x70);
      fVar4 = *(float *)(this + 0x1de0);
      fVar5 = *(float *)(this + 0x1de4);
      fVar6 = *(float *)(this + 0x1de8);
      if (((byte)this[0x14d] & 8) != 0) {
        CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
      }
      local_94 = (fVar1 * fVar13 + fVar4) * 0.5 + *(float *)(this + 0x2e0) * 0.5;
      local_98 = (fVar2 * fVar13 + fVar5) * 0.5 + *(float *)(this + 0x2e4) * 0.5;
      local_90 = (fVar13 * fVar3 + fVar6) * 0.5 + *(float *)(this + 0x2e8) * 0.5;
    }
    if (((byte)this[0x186] & 0xfd) == 8) {
      uVar12 = 2;
    }
    else {
      uVar12 = *(uint *)(this + 0x150) >> 1 & 1;
    }
    if (*(uint *)(this + 0x1da4) != uVar12) {
      uVar7 = *(uint *)(this + 0x14c);
      if ((uVar7 & 0x1000) != 0) {
        CBaseEntity::CalcAbsoluteVelocity((CBaseEntity *)this);
        uVar7 = *(uint *)(this + 0x14c);
      }
      if ((uVar7 & 0x800) != 0) {
        CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
      }
      SetVCollisionState(this,(Vector *)(this + 0x2e0),(Vector *)(this + 0x274),uVar12);
    }
    puVar11 = g_pMoveData;
    if ((this[0x1df8] == (CBasePlayer)0x0) && (iVar10 == 0)) {
      fVar13 = *(float *)(this + 0x1ff8);
      if (fVar13 <= 0.0) {
        fVar13 = *(float *)(sv_maxspeed._28_4_ + 0x2c);
      }
      *(float *)(g_pMoveData + 0x68) = fVar13;
      *(float *)(puVar11 + 0x6c) = fVar13;
      *(float *)(puVar11 + 0x70) = fVar13;
    }
    if (0.1 < *(float *)(puVar11 + 100)) {
      if (*(float *)(puVar11 + 100) <= 4.0) {
        (**(code **)(**(int **)(this + 0x238) + 0xc4))
                  (*(int **)(this + 0x238),(Vector *)&local_88,0);
        local_7c = local_88;
        local_78 = local_84;
        local_74 = local_80 + *(float *)(g_pMoveData + 100);
        uVar12 = (**(code **)(*(int *)this + 0x7a0))(this,0);
        UTIL_TraceEntity((CBaseEntity *)this,(Vector *)&local_88,(Vector *)&local_7c,uVar12,
                         (IHandleEntity *)this,8,local_70);
        if (((local_44 < 1.0) || (local_3a != '\0')) || (local_39 != '\0')) {
          local_5c = local_5c - local_80;
          *(float *)(g_pMoveData + 100) = local_5c;
        }
        else {
          local_5c = *(float *)(g_pMoveData + 100);
        }
        (**(code **)(**(int **)(this + 0x1dd4) + 0x20))(*(int **)(this + 0x1dd4),local_5c);
      }
      else {
        piVar8 = *(int **)(this + 0x238);
        pcVar9 = *(code **)(*piVar8 + 0xbc);
        if (((byte)this[0x14d] & 8) != 0) {
          CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
        }
        (*pcVar9)(piVar8,this + 0x2e0,&vec3_angle,1);
      }
      (**(code **)(**(int **)(this + 0x1dd4) + 0x24))(*(int **)(this + 0x1dd4));
      puVar11 = g_pMoveData;
    }
    *(undefined4 *)(puVar11 + 100) = 0;
    *(float *)(this + 0x20d0) = local_94;
    *(float *)(this + 0x20d4) = local_98;
    *(float *)(this + 0x20d8) = local_90;
    *(undefined4 *)(this + 0x20dc) = *(undefined4 *)(puVar11 + 0x68);
    *(undefined4 *)(this + 0x20e0) = *(undefined4 *)(puVar11 + 0x6c);
    *(undefined4 *)(this + 0x20e4) = *(undefined4 *)(puVar11 + 0x70);
    if (((byte)this[0x14d] & 8) != 0) {
      CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
    }
    *(undefined4 *)(this + 0x1de0) = *(undefined4 *)(this + 0x2e0);
    *(undefined4 *)(this + 0x1de4) = *(undefined4 *)(this + 0x2e4);
    *(undefined4 *)(this + 0x1de8) = *(undefined4 *)(this + 0x2e8);
  }
  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)