L L4D2node

CTerrorGameMovement::HandleCustomCollision

0x004fd8a0 · 3298 bytes · __thiscall

_ZN19CTerrorGameMovement21HandleCustomCollisionERK6VectorS2_P10CGameTrace

Decompiled

undefined (4 params)

/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* CTerrorGameMovement::HandleCustomCollision(Vector const&, Vector const&, CGameTrace*) */

void __thiscall
CTerrorGameMovement::HandleCustomCollision
          (CTerrorGameMovement *this,Vector *param_1,Vector *param_2,CGameTrace *param_3)

{
  float fVar1;
  float fVar2;
  float fVar3;
  float fVar4;
  float fVar5;
  float fVar6;
  CBaseEntity *this_00;
  CBaseEntity *pCVar7;
  code *pcVar8;
  int *piVar9;
  bool bVar10;
  CTerrorPlayer *pCVar11;
  char cVar12;
  int iVar13;
  uint uVar14;
  int iVar15;
  CHunterClaw *this_01;
  undefined4 uVar16;
  undefined *puVar17;
  bool bVar18;
  CBaseEntity *local_d4;
  CTerrorPlayer *local_c8;
  undefined4 local_c4;
  undefined4 local_c0;
  undefined4 local_b8;
  undefined4 local_b4;
  int local_b0;
  float local_ac;
  float local_a8;
  float local_a4;
  undefined4 local_a0;
  undefined4 local_9c;
  undefined4 local_98;
  float local_94;
  float local_90;
  float local_8c;
  float local_88;
  float local_84;
  float local_80;
  CGameTrace local_7c [12];
  float local_70;
  float local_6c;
  float local_68;
  float local_50;
  char local_45;
  
  local_c4 = 0;
  local_c0 = 0;
  if (___atan2f_finite == 0) {
    local_b0 = 0;
  }
  else {
    (**(code **)(___atan2f_finite + 0x50))
              (___atan2f_finite,&local_c4,0,0,0,0,
               "/data/src/game/server/../../game/shared/terror/terrorgamemovement.cpp",0x5bb,
               &HandleCustomCollision(Vector_const&,Vector_const&,CGameTrace*)::tm_fmt,"(%s)%s",
               "Unaccounted","CTerrorGameMovement::HandleCustomCollisions");
    local_b0 = ___atan2f_finite;
  }
  iVar13 = _DAT_0105db00;
  local_b8 = local_c4;
  local_b4 = local_c0;
                    /* try { // try from 004fdbae to 004fdbfc has its CatchHandler @ 004fe5df */
  if (((_DAT_0105d154 != 0) || (DAT_0105d158 == '\0')) &&
     (iVar15 = ThreadGetCurrentId(), iVar13 == iVar15)) {
    if ((char *)*_DAT_0105d15c != "CTerrorGameMovement::HandleCustomCollisions") {
      _DAT_0105d15c =
           (int *)CVProfNode::GetSubNode((char *)_DAT_0105d15c,0xc2937c,(char *)0x1,0xbfafa1);
    }
    CVProfNode::EnterScope();
    DAT_0105d158 = '\0';
  }
                    /* try { // try from 004fd988 to 004fdb2b has its CatchHandler @ 004fe5a8 */
  if (((*(int *)(this + 4) == 0) ||
      (cVar12 = (**(code **)(**(int **)(this + 0x810) + 0x558))(*(int **)(this + 0x810)),
      cVar12 != '\0')) ||
     ((param_3 == (CGameTrace *)0x0 ||
      (this_00 = *(CBaseEntity **)(param_3 + 0x4c), this_00 == (CBaseEntity *)0x0))))
  goto LAB_004fdb40;
  pCVar7 = *(CBaseEntity **)(this + 0x810);
  iVar13 = CBaseEntity::GetTeamNumber(pCVar7);
                    /* try { // try from 004fde73 to 004fe59c has its CatchHandler @ 004fe5a8 */
  if (((iVar13 == 3) && (iVar13 = (**(code **)(*(int *)pCVar7 + 0x544))(pCVar7), iVar13 == 3)) &&
     (cVar12 = CTerrorPlayer::IsLunging(*(CTerrorPlayer **)(this + 0x810)), cVar12 != '\0')) {
    *(undefined4 *)(this + 0x814) = *(undefined4 *)param_3;
    *(undefined4 *)(this + 0x818) = *(undefined4 *)(param_3 + 4);
    *(undefined4 *)(this + 0x81c) = *(undefined4 *)(param_3 + 8);
    *(undefined4 *)(this + 0x820) = *(undefined4 *)(param_3 + 0xc);
    *(undefined4 *)(this + 0x824) = *(undefined4 *)(param_3 + 0x10);
    *(undefined4 *)(this + 0x828) = *(undefined4 *)(param_3 + 0x14);
    *(undefined4 *)(this + 0x82c) = *(undefined4 *)(param_3 + 0x18);
    *(undefined4 *)(this + 0x830) = *(undefined4 *)(param_3 + 0x1c);
    *(undefined4 *)(this + 0x834) = *(undefined4 *)(param_3 + 0x20);
    *(undefined4 *)(this + 0x838) = *(undefined4 *)(param_3 + 0x24);
    this[0x83c] = *(CTerrorGameMovement *)(param_3 + 0x28);
    this[0x83d] = *(CTerrorGameMovement *)(param_3 + 0x29);
    *(undefined2 *)(this + 0x83e) = *(undefined2 *)(param_3 + 0x2a);
    *(undefined4 *)(this + 0x840) = *(undefined4 *)(param_3 + 0x2c);
    *(undefined4 *)(this + 0x844) = *(undefined4 *)(param_3 + 0x30);
    *(undefined2 *)(this + 0x848) = *(undefined2 *)(param_3 + 0x34);
    this[0x84a] = *(CTerrorGameMovement *)(param_3 + 0x36);
    this[0x84b] = *(CTerrorGameMovement *)(param_3 + 0x37);
    *(undefined4 *)(this + 0x84c) = *(undefined4 *)(param_3 + 0x38);
    uVar16 = *(undefined4 *)(param_3 + 0x40);
    *(undefined4 *)(this + 0x850) = *(undefined4 *)(param_3 + 0x3c);
    *(undefined4 *)(this + 0x854) = uVar16;
    *(undefined4 *)(this + 0x858) = *(undefined4 *)(param_3 + 0x44);
    *(undefined2 *)(this + 0x85c) = *(undefined2 *)(param_3 + 0x48);
    *(undefined2 *)(this + 0x85e) = *(undefined2 *)(param_3 + 0x4a);
    *(undefined4 *)(this + 0x860) = *(undefined4 *)(param_3 + 0x4c);
    *(undefined4 *)(this + 0x864) = *(undefined4 *)(param_3 + 0x50);
    cVar12 = (**(code **)(**(int **)(this + 0x810) + 0x558))(*(int **)(this + 0x810));
    if ((cVar12 == '\0') && (*(char *)(*(int *)(this + 0x810) + 0x3e78) == '\0')) {
      cVar12 = (**(code **)(*(int *)this_00 + 0x16c))(this_00);
      if (cVar12 == '\0') {
        local_c8 = (CTerrorPlayer *)0x0;
      }
      else {
        local_c8 = (CTerrorPlayer *)this_00;
        if (*(int *)(this + 0x808) < 1) {
LAB_004fe030:
          cVar12 = (**(code **)(*(int *)this_00 + 0x918))(this_00);
          if (cVar12 != '\0') {
            this_01 = (CHunterClaw *)CCSPlayer::GetActiveCSWeapon(*(CCSPlayer **)(this + 0x810));
            iVar13 = (**(code **)(*(int *)this_01 + 0x638))(this_01);
            if (iVar13 == 0x27) {
              CHunterClaw::OnLungedPlayer(this_01);
            }
            CUtlVector<CTerrorPlayer*,CUtlMemory<CTerrorPlayer*,int>>::InsertBefore
                      ((CUtlVector<CTerrorPlayer*,CUtlMemory<CTerrorPlayer*,int>> *)(this + 0x7fc),
                       *(int *)(this + 0x808),&local_c8);
            pCVar11 = local_c8;
            if (((byte)*(CBaseEntity *)(local_c8 + 0x14d) & 8) != 0) {
              CBaseEntity::CalcAbsolutePosition((CBaseEntity *)local_c8);
            }
            local_ac = *(float *)(pCVar11 + 0x2e0);
            local_a8 = *(float *)(pCVar11 + 0x2e4);
            local_a4 = *(float *)(pCVar11 + 0x2e8);
            iVar13 = *(int *)(this + 8);
            local_a0 = *(undefined4 *)(iVar13 + 0x40);
            local_9c = *(undefined4 *)(iVar13 + 0x44);
            local_98 = *(undefined4 *)(iVar13 + 0x48);
            TryOtherPlayerMove(this,local_c8,(Vector *)&local_ac,(Vector *)&local_a0,(Vector *)0x0,
                               (CGameTrace *)0x0);
            uVar14 = (**(code **)(*(int *)this + 0x40))(this,0,local_c8);
            pCVar11 = local_c8;
            local_80 = *(float *)(local_c8 + 0x1acc);
            if (((byte)*(CBaseEntity *)(local_c8 + 0x14d) & 8) == 0) {
              local_88 = *(float *)(local_c8 + 0x2e0);
              local_d4 = (CBaseEntity *)local_c8;
              local_84 = *(float *)(local_c8 + 0x2e4);
              local_80 = local_80 + *(float *)(local_c8 + 0x2e8);
            }
            else {
              CBaseEntity::CalcAbsolutePosition((CBaseEntity *)local_c8);
              local_d4 = (CBaseEntity *)local_c8;
              local_88 = *(float *)(pCVar11 + 0x2e0);
              local_84 = *(float *)(pCVar11 + 0x2e4);
              local_80 = local_80 + *(float *)(pCVar11 + 0x2e8);
              if ((*(uint *)(local_c8 + 0x14c) & 0x800) != 0) {
                CBaseEntity::CalcAbsolutePosition((CBaseEntity *)local_c8);
              }
            }
            TraceOtherPlayerBBox
                      (local_c8,(Vector *)(local_d4 + 0x2e0),(Vector *)&local_88,uVar14,8,local_7c,
                       (int *)(this + 2000));
            if (0.0 < local_50) {
              local_94 = local_70;
              local_90 = local_6c;
              local_8c = local_68;
              iVar13 = *(int *)(this + 8);
              local_88 = *(float *)(iVar13 + 0x40);
              local_84 = *(float *)(iVar13 + 0x44);
              local_80 = *(float *)(iVar13 + 0x48);
              TryOtherPlayerMove(this,local_c8,(Vector *)&local_94,(Vector *)&local_88,(Vector *)0x0
                                 ,(CGameTrace *)0x0);
              pCVar11 = local_c8;
              local_70 = local_94 - local_70;
              local_6c = local_90 - local_6c;
              local_68 = local_8c - local_68;
              if (((byte)*(CBaseEntity *)(local_c8 + 0x14d) & 8) != 0) {
                CBaseEntity::CalcAbsolutePosition((CBaseEntity *)local_c8);
              }
              if ((local_a8 - *(float *)(pCVar11 + 0x2e4)) *
                  (local_a8 - *(float *)(pCVar11 + 0x2e4)) +
                  (local_a4 - *(float *)(pCVar11 + 0x2e8)) *
                  (local_a4 - *(float *)(pCVar11 + 0x2e8)) +
                  (local_ac - *(float *)(pCVar11 + 0x2e0)) *
                  (local_ac - *(float *)(pCVar11 + 0x2e0)) <
                  local_6c * local_6c + local_68 * local_68 + local_70 * local_70) {
                local_ac = local_94;
                local_a8 = local_90;
                local_a4 = local_8c;
              }
            }
            CBaseEntity::SetAbsOrigin((CBaseEntity *)local_c8,(Vector *)&local_ac);
            CTerrorPlayer::OnLungedInto(*(CTerrorPlayer **)(this + 0x810),local_c8);
            fVar1 = *(float *)(*(int *)(this + 8) + 0x48);
            if (0.0 < fVar1) {
              *(float *)(*(int *)(this + 8) + 0x48) = fVar1 * 0.5;
            }
            pcVar8 = *(code **)(*(int *)this + 0x3c);
            uVar16 = (**(code **)(*(int *)this + 0x40))(this,0,0);
            (*pcVar8)(this,param_1,param_2,uVar16,8,param_3);
            CBaseEntity::SetAbsVelocity
                      ((CBaseEntity *)local_c8,(Vector *)(*(int *)(this + 8) + 0x40));
            goto LAB_004fdb40;
          }
        }
        else if (this_00 != (CBaseEntity *)**(int **)(this + 0x7fc)) {
          iVar13 = 0;
          do {
            iVar13 = iVar13 + 1;
            if (iVar13 == *(int *)(this + 0x808)) goto LAB_004fe030;
          } while (this_00 != (CBaseEntity *)(*(int **)(this + 0x7fc))[iVar13]);
          if (iVar13 < 0) goto LAB_004fe030;
        }
      }
      if ((*(int *)(param_3 + 0x4c) != 0) &&
         (iVar13 = __dynamic_cast(*(int *)(param_3 + 0x4c),&CBaseEntity::typeinfo,
                                  &Infected::typeinfo,0), iVar13 != 0)) {
        (**(code **)(*(int *)(iVar13 + 0x1a3c) + 0x74))
                  (iVar13 + 0x1a3c,*(undefined4 *)(this + 0x810));
        goto LAB_004fdb40;
      }
    }
  }
  if ((*(char **)(this_00 + 0x7c) == "pipe_bomb_projectile") ||
     (cVar12 = CBaseEntity::ClassMatchesComplex(this_00,"pipe_bomb_projectile"), cVar12 != '\0')) {
    fVar1 = *(float *)param_2;
    fVar2 = *(float *)param_1;
    fVar3 = *(float *)(param_2 + 4);
    fVar4 = *(float *)(param_1 + 4);
    fVar5 = *(float *)(param_2 + 8);
    fVar6 = *(float *)(param_1 + 8);
    if (((byte)this_00[0x14d] & 8) != 0) {
      CBaseEntity::CalcAbsolutePosition(this_00);
    }
    local_94 = *(float *)(this_00 + 0x2e0);
    local_90 = *(float *)(this_00 + 0x2e4);
    local_88 = (fVar1 + local_94) - fVar2;
    local_8c = *(float *)(this_00 + 0x2e8);
    local_84 = (fVar3 + local_90) - fVar4;
    local_80 = (fVar5 + local_8c) - fVar6;
    iVar13 = *(int *)(this_00 + 0x234);
    uVar14 = (**(code **)(*(int *)this_00 + 0x2c8))(this_00);
    UTIL_TraceEntity(this_00,(Vector *)&local_94,(Vector *)&local_88,uVar14,(IHandleEntity *)this_00
                     ,iVar13,local_7c);
    if ((local_50 <= 0.0) || (local_45 != '\0')) goto LAB_004fdb40;
    CBaseEntity::SetAbsOrigin(this_00,(Vector *)&local_88);
  }
  else {
    pCVar7 = *(CBaseEntity **)(this + 0x810);
                    /* try { // try from 004fdc77 to 004fddc1 has its CatchHandler @ 004fe5a8 */
    iVar13 = CBaseEntity::GetTeamNumber(pCVar7);
    cVar12 = IsASurvivorTeam(iVar13);
    bVar18 = false;
    if (cVar12 == '\0') {
      bVar18 = *(int *)(pCVar7 + 0x2ba4) == 6;
      cVar12 = !bVar18;
    }
    iVar13 = *(int *)(this + 8);
    bVar10 = 14400.0 < *(float *)(iVar13 + 0x48) * *(float *)(iVar13 + 0x48) +
                       *(float *)(iVar13 + 0x44) * *(float *)(iVar13 + 0x44) +
                       *(float *)(iVar13 + 0x40) * *(float *)(iVar13 + 0x40);
    if ((cVar12 != '\0') && (!bVar10)) goto LAB_004fdb40;
    local_88 = *(float *)(param_3 + 0xc) - *(float *)param_3;
    local_84 = *(float *)(param_3 + 0x10) - *(float *)(param_3 + 4);
    local_80 = *(float *)(param_3 + 0x14) - *(float *)(param_3 + 8);
    VectorNormalize((Vector *)&local_88);
    uVar14 = *(uint *)(*(int *)(this + 0x810) + 0x30bc);
    if ((uVar14 == 0xffffffff) ||
       ((((puVar17 = g_pEntityList + (uVar14 & 0xfff) * 0x10, puVar17 == (undefined *)0xfffffffc ||
          (*(uint *)(puVar17 + 8) != uVar14 >> 0xc)) ||
         (piVar9 = *(int **)(puVar17 + 4), piVar9 == (int *)0x0)) ||
        (cVar12 = (**(code **)(*piVar9 + 0x388))
                            (piVar9,this_00,param_3 + 0xc,(Vector *)&local_88,param_3,
                             *(undefined4 *)(this + 8)), cVar12 == '\0')))) {
      if (((!bVar18) || (bVar10)) && (cVar12 = IsFlimsy(this_00), cVar12 != '\0')) {
        CTakeDamageInfo::CTakeDamageInfo
                  ((CTakeDamageInfo *)local_7c,*(CBaseEntity **)(this + 4),
                   *(CBaseEntity **)(this + 4),10.0,1,0);
        CalculateExplosiveDamageForce
                  ((CTakeDamageInfo *)local_7c,(Vector *)&local_88,(Vector *)(param_3 + 0xc),1.0);
        for (iVar13 = IPredictionSystem::g_pPredictionSystems; iVar13 != 0;
            iVar13 = *(int *)(iVar13 + 4)) {
          *(int *)(iVar13 + 0x10) = *(int *)(iVar13 + 0x10) + 1;
        }
                    /* try { // try from 004fdde5 to 004fde27 has its CatchHandler @ 004fe5cc */
        CBaseEntity::TakeDamage(this_00,(CTakeDamageInfo *)local_7c);
        pcVar8 = *(code **)(*(int *)this + 0x3c);
        uVar16 = (**(code **)(*(int *)this + 0x40))(this,0,0);
        (*pcVar8)(this,param_1,param_2,uVar16,8,param_3);
        for (iVar13 = IPredictionSystem::g_pPredictionSystems; iVar13 != 0;
            iVar13 = *(int *)(iVar13 + 4)) {
          *(int *)(iVar13 + 0x10) = *(int *)(iVar13 + 0x10) + -1;
        }
        CVProfile::ExitScope((CVProfile *)&g_VProfCurrentProfile);
        Tm_Zone::~Tm_Zone((Tm_Zone *)&local_b8);
        return;
      }
      goto LAB_004fdb40;
    }
  }
  pcVar8 = *(code **)(*(int *)this + 0x3c);
  uVar16 = (**(code **)(*(int *)this + 0x40))(this,0,0);
  (*pcVar8)(this,param_1,param_2,uVar16,8,param_3);
LAB_004fdb40:
  iVar13 = _DAT_0105db00;
  if (((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) &&
     (iVar15 = ThreadGetCurrentId(), iVar13 == iVar15)) {
    cVar12 = CVProfNode::ExitScope();
    if (cVar12 != '\0') {
      _DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
    }
    DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
  }
  if (local_b0 != 0) {
    (**(code **)(local_b0 + 0x54))(local_b0,local_b8,local_b4,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)