L L4D2node

CGameMovement::CategorizePosition

0x0045b230 · 1933 bytes · __thiscall

_ZN13CGameMovement18CategorizePositionEb

Decompiled

undefined (2 params)

/* CGameMovement::CategorizePosition(bool) */

void __thiscall CGameMovement::CategorizePosition(CGameMovement *this,bool param_1)

{
  float fVar1;
  CBaseEntity CVar2;
  float fVar3;
  float fVar4;
  bool bVar5;
  bool bVar6;
  ITraceFilter *pIVar7;
  char cVar8;
  CBaseEntity *this_00;
  undefined4 uVar9;
  undefined4 uVar10;
  float *pfVar11;
  CBaseEntity *this_01;
  uint uVar12;
  Vector *pVVar13;
  Vector *pVVar14;
  int *piVar15;
  int iVar16;
  CBasePlayer *pCVar17;
  CBaseEntity CVar18;
  CBasePlayer CVar19;
  longdouble lVar20;
  undefined4 local_e8;
  float local_e4;
  float local_e0;
  float local_dc;
  float local_d8;
  float local_d4;
  float local_d0;
  ITraceFilter *local_cc;
  float local_c8;
  float local_c4;
  float local_bc;
  float local_b8;
  float local_b4;
  float local_ac;
  float local_a8;
  float local_a4;
  float local_9c;
  float local_98;
  float local_94;
  undefined4 local_8c;
  undefined1 local_88;
  undefined1 local_87;
  CGameTrace local_70 [12];
  undefined4 local_64;
  undefined4 local_60;
  undefined4 local_5c;
  float local_50;
  float local_44;
  char local_39;
  short local_30;
  int local_24;
  
  *(undefined4 *)(*(int *)(this + 4) + 0x2180) = 0x3f800000;
  (**(code **)(*(int *)this + 0xc4))(this);
  this_00 = *(CBaseEntity **)(this + 4);
  if (((byte)this_00[0x1d20] & 8) != 0) {
    cVar8 = (**(code **)(*(int *)this_00 + 0x558))(this_00);
    if (cVar8 == '\0') {
      return;
    }
    this_00 = *(CBaseEntity **)(this + 4);
  }
  CVar18 = this_00[0x186];
  if (CVar18 == (CBaseEntity)0x8) {
LAB_0045b6a0:
    (**(code **)(*(int *)this + 0x100))(this,0);
    return;
  }
  iVar16 = *(int *)(this + 8);
  local_d4 = *(float *)(iVar16 + 0xa0);
  local_d0 = *(float *)(iVar16 + 0xa4);
  local_d8 = *(float *)(iVar16 + 0x9c);
  local_e0 = local_d4 - (*(float *)(this + 0x7d8) + *(float *)(this + 0x7d8));
  local_dc = local_d0 - (*(float *)(this + 0x7dc) + *(float *)(this + 0x7dc));
  local_e4 = local_d8 - (*(float *)(this + 0x7d4) + *(float *)(this + 0x7d4));
  fVar1 = *(float *)(iVar16 + 0x48);
  bVar5 = false;
  if (140.0 < fVar1) {
    this_01 = (CBaseEntity *)CBaseEntity::GetGroundEntity(this_00);
    if (this_01 == (CBaseEntity *)0x0) {
      this_00 = *(CBaseEntity **)(this + 4);
      bVar5 = true;
      CVar18 = this_00[0x186];
    }
    else {
      if (((byte)this_01[0x14d] & 0x10) != 0) {
        CBaseEntity::CalcAbsoluteVelocity(this_01);
      }
      this_00 = *(CBaseEntity **)(this + 4);
      CVar18 = this_00[0x186];
      bVar5 = 140.0 < fVar1 - *(float *)(this_01 + 0x27c);
    }
  }
  CVar2 = this_00[0x253];
  if ((((CVar18 == (CBaseEntity)0x2) &&
       (iVar16 = CBaseEntity::GetGroundEntity(this_00), iVar16 != 0)) && ((byte)CVar2 < 3)) ||
     (param_1)) {
    local_dc = local_dc - *(float *)(*(int *)(this + 4) + 0x1acc);
    bVar6 = true;
  }
  else {
    bVar6 = false;
  }
  if ((bVar5) || ((0.0 < fVar1 && (*(char *)(*(int *)(this + 4) + 0x186) == '\t'))))
  goto LAB_0045b6a0;
  uVar9 = (**(code **)(*(int *)this + 0x108))(this,8);
  local_e8 = uVar9;
  uVar10 = (**(code **)(*(int *)this + 0x40))(this,0,0);
  pfVar11 = (float *)(**(code **)(*(int *)this + 0x80))(this);
  fVar1 = pfVar11[2];
  fVar3 = *pfVar11;
  fVar4 = pfVar11[1];
  pfVar11 = (float *)(**(code **)(*(int *)this + 0x7c))(this);
  local_8c = 0;
  local_bc = local_e4 - local_d8;
  *(int *)(this + 2000) = *(int *)(this + 2000) + 1;
  local_b8 = local_e0 - local_d4;
  local_b4 = local_dc - (local_d0 + 4.0);
  local_87 = local_b8 * local_b8 + local_bc * local_bc + local_b4 * local_b4 != 0.0;
  local_9c = (fVar3 - *pfVar11) * 0.5;
  local_98 = (fVar4 - pfVar11[1]) * 0.5;
  local_94 = ((fVar1 - 4.0) - pfVar11[2]) * 0.5;
  local_88 = local_98 * local_98 + local_9c * local_9c + local_94 * local_94 < 1e-06;
  local_ac = (fVar3 + *pfVar11) * 0.5;
  local_a8 = (fVar4 + pfVar11[1]) * 0.5;
  local_cc = (ITraceFilter *)(local_d8 + local_ac);
  local_a4 = ((fVar1 - 4.0) + pfVar11[2]) * 0.5;
  local_c8 = local_d4 + local_a8;
  local_c4 = local_d0 + 4.0 + local_a4;
  piVar15 = *(int **)(this + 0x7cc);
  local_ac = -local_ac;
  local_a8 = -local_a8;
  local_a4 = -local_a4;
  if (piVar15 == (int *)0x0) {
LAB_0045b8c0:
    (**(code **)(*enginetrace + 0x14))(enginetrace,&local_cc,uVar10,uVar9,local_70);
  }
  else {
    cVar8 = (**(code **)(*piVar15 + 0x10))(piVar15,&local_cc);
    if (cVar8 == '\0') goto LAB_0045b8c0;
    (**(code **)(*enginetrace + 0x20))
              (enginetrace,&local_cc,*(undefined4 *)(this + 0x7cc),uVar10,uVar9,local_70);
  }
  (**(code **)(*(int *)this + 0x10c))(this,&local_e8);
  fVar1 = local_50;
  if ((local_24 == 0) ||
     (lVar20 = (longdouble)(**(code **)(*(int *)this + 0x38))(this), fVar1 < (float)lVar20)) {
    local_cc = (ITraceFilter *)(**(code **)(*(int *)this + 0x108))(this,8);
    lVar20 = (longdouble)(**(code **)(*(int *)this + 0x38))(this);
    pIVar7 = local_cc;
    uVar12 = (**(code **)(*(int *)this + 0x40))(this,0,0);
    pVVar13 = (Vector *)(**(code **)(*(int *)this + 0x80))(this);
    pVVar14 = (Vector *)(**(code **)(*(int *)this + 0x7c))(this);
    TracePlayerBBoxForGround
              (*(ITraceListData **)(this + 0x7cc),(Vector *)&local_d8,(Vector *)&local_e4,pVVar14,
               pVVar13,uVar12,pIVar7,local_70,(float)lVar20,true,(int *)(this + 2000));
    (**(code **)(*(int *)this + 0x10c))(this,&local_cc);
    if ((local_24 == 0) ||
       (lVar20 = (longdouble)(**(code **)(*(int *)this + 0x38))(this), local_50 < (float)lVar20)) {
      (**(code **)(*(int *)this + 0x100))(this,0);
      if (0.0 < *(float *)(*(int *)(this + 8) + 0x48)) {
        piVar15 = *(int **)(this + 4);
        if (*(char *)((int)piVar15 + 0x186) == '\b') {
          bVar6 = false;
          goto LAB_0045b631;
        }
        piVar15[0x860] = 0x3e800000;
      }
      piVar15 = *(int **)(this + 4);
      bVar6 = false;
      goto LAB_0045b631;
    }
  }
  (**(code **)(*(int *)this + 0x100))(this,local_70);
  piVar15 = *(int **)(this + 4);
LAB_0045b631:
  cVar8 = (**(code **)(*piVar15 + 0x4fc))(piVar15);
  if (cVar8 == '\0') {
    piVar15 = (int *)(**(code **)(*IMoveHelper::sm_pSingleton + 0x30))(IMoveHelper::sm_pSingleton);
    iVar16 = (**(code **)(*piVar15 + 0x18))(piVar15,(int)local_30);
    CVar19 = *(CBasePlayer *)(iVar16 + 0x4c);
    iVar16 = CBaseEntity::GetGroundEntity(*(CBaseEntity **)(this + 4));
    pCVar17 = *(CBasePlayer **)(this + 4);
    if (iVar16 == 0) {
      CVar19 = (CBasePlayer)0x0;
    }
    if (pCVar17[0x2185] != CVar19) {
      CEnvPlayerSurfaceTrigger::SetPlayerSurface(pCVar17,(char)CVar19);
      pCVar17 = *(CBasePlayer **)(this + 4);
    }
    pCVar17[0x2185] = CVar19;
  }
  if (!bVar6) {
    return;
  }
  if (local_39 != '\0') {
    return;
  }
  if (local_44 <= 0.0) {
    return;
  }
  if (1.0 <= local_44) {
    return;
  }
  iVar16 = *(int *)(this + 8);
  *(undefined4 *)(iVar16 + 0x9c) = local_64;
  *(undefined4 *)(iVar16 + 0xa0) = local_60;
  *(undefined4 *)(iVar16 + 0xa4) = local_5c;
  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)