L L4D2node

CTerrorPlayer::UpdateLedgeHang

0x009a9b60 · 1066 bytes · __thiscall

_ZN13CTerrorPlayer15UpdateLedgeHangEv

Decompiled

undefined (1 param)

/* CTerrorPlayer::UpdateLedgeHang() */

void __thiscall CTerrorPlayer::UpdateLedgeHang(CTerrorPlayer *this)

{
  float fVar1;
  float fVar2;
  float fVar3;
  float fVar4;
  float fVar5;
  float fVar6;
  uint uVar7;
  code *pcVar8;
  CBaseEdict *pCVar9;
  undefined4 uVar10;
  int *piVar11;
  int iVar12;
  undefined *puVar13;
  undefined **local_dc [4];
  float local_cc;
  float local_c8;
  float local_c4;
  undefined4 local_bc;
  undefined4 local_b8;
  undefined4 local_b4;
  undefined4 local_ac;
  undefined4 local_a8;
  undefined4 local_a4;
  undefined4 local_9c;
  undefined4 local_98;
  undefined4 local_94;
  undefined4 local_8c;
  undefined1 local_88;
  undefined1 local_87;
  undefined1 local_70 [32];
  float local_50;
  float local_44;
  char local_39;
  
  uVar7 = *(uint *)(this + 0x2e24);
  if ((((uVar7 != 0xffffffff) &&
       (puVar13 = g_pEntityList + (uVar7 & 0xfff) * 0x10, puVar13 != (undefined *)0xfffffffc)) &&
      (*(uint *)(puVar13 + 8) == uVar7 >> 0xc)) && (*(int *)(puVar13 + 4) != 0)) {
    return;
  }
  fVar1 = *(float *)(this + 0x3a28);
  fVar2 = *(float *)(this + 0x3a20);
  fVar3 = *(float *)(this + 0x3a10);
  fVar4 = *(float *)(this + 0x3a24);
  fVar5 = *(float *)(this + 0x3a08);
  fVar6 = *(float *)(this + 0x3a0c);
  CTraceFilterSimple::CTraceFilterSimple
            ((CTraceFilterSimple *)local_dc,(IHandleEntity *)this,8,
             (_func_bool_IHandleEntity_ptr_int *)0x0);
  local_b8 = 0;
  local_87 = 1;
  local_94 = 0x3f000000;
  local_b4 = 0xc2c80000;
  local_8c = 0;
  local_9c = 0x40000000;
  local_c4 = fVar3 + 0.5 + fVar1 * 12.0;
  local_88 = 0;
  local_98 = 0x40000000;
  local_ac = 0;
  local_a8 = 0;
  local_a4 = 0xbf000000;
  local_dc[0] = &PTR_ShouldHitEntity_00c54558;
  local_bc = 0;
  pcVar8 = *(code **)(*enginetrace + 0x14);
  local_cc = fVar2 * 12.0 + fVar5;
  local_c8 = fVar4 * 12.0 + fVar6;
  uVar10 = (**(code **)(*(int *)this + 0x7a0))(this,0);
  (*pcVar8)(enginetrace,&local_cc,uVar10,(CTraceFilterSimple *)local_dc,local_70);
  if ((local_39 != '\0') || ((local_44 < 1.0 && (0.7 <= local_50)))) {
    iVar12 = *(int *)(this + 0x39e8);
    if (iVar12 != *(int *)(this + 0x100)) {
      (**(code **)(*(int *)this + 0x214))(this,this + 0x100);
      *(int *)(this + 0x100) = iVar12;
    }
    SetHealthBuffer(this,(float)*(int *)(this + 0x39ec));
    (**(code **)(*(int *)(this + 0x3ab4) + 0x120))(this + 0x3ab4);
    CBaseEntity::SetAbsOrigin((CBaseEntity *)this,(Vector *)(this + 0x3a08));
    piVar11 = (int *)(**(code **)(*gameeventmanager + 0x1c))
                               (gameeventmanager,"player_ledge_release",0,0);
    if (piVar11 != (int *)0x0) {
      pcVar8 = *(code **)(*piVar11 + 0x30);
      uVar10 = (**(code **)(*engine + 0x40))(engine,*(undefined4 *)(this + 0x30));
      (*pcVar8)(piVar11,"userid",uVar10);
      (**(code **)(*gameeventmanager + 0x20))(gameeventmanager,piVar11,0);
    }
    if (this[0x2d94] != (CTerrorPlayer)0x0) {
      if (this[0x6c] == (CTerrorPlayer)0x0) {
        pCVar9 = *(CBaseEdict **)(this + 0x30);
        if (pCVar9 != (CBaseEdict *)0x0) {
          *(uint *)pCVar9 = *(uint *)pCVar9 | 0x101;
          iVar12 = CBaseEdict::GetChangeAccessor(pCVar9);
          *(undefined2 *)(iVar12 + 2) = 0;
        }
      }
      else {
        this[0x70] = (CTerrorPlayer)((byte)this[0x70] | 1);
      }
      this[0x2d94] = (CTerrorPlayer)0x0;
    }
    *(undefined4 *)(this + 0x2da8) = 0xffffffff;
    if (*(float *)(this + 0x2db0) != -1.0) {
      (**(code **)(*(int *)(this + 0x2dac) + 4))(this + 0x2dac,this + 0x2db0);
      *(undefined4 *)(this + 0x2db0) = 0xbf800000;
    }
    if (this[0x39f1] != (CTerrorPlayer)0x0) {
      if (this[0x6c] == (CTerrorPlayer)0x0) {
        pCVar9 = *(CBaseEdict **)(this + 0x30);
        if (pCVar9 != (CBaseEdict *)0x0) {
          *(uint *)pCVar9 = *(uint *)pCVar9 | 0x101;
          iVar12 = CBaseEdict::GetChangeAccessor(pCVar9);
          *(undefined2 *)(iVar12 + 2) = 0;
        }
      }
      else {
        this[0x70] = (CTerrorPlayer)((byte)this[0x70] | 1);
      }
      this[0x39f1] = (CTerrorPlayer)0x0;
    }
    ResetLightingOrigin(this);
    if (this[0x39f2] != (CTerrorPlayer)0x0) {
      if (this[0x6c] == (CTerrorPlayer)0x0) {
        pCVar9 = *(CBaseEdict **)(this + 0x30);
        if (pCVar9 != (CBaseEdict *)0x0) {
          *(uint *)pCVar9 = *(uint *)pCVar9 | 0x101;
          iVar12 = CBaseEdict::GetChangeAccessor(pCVar9);
          *(undefined2 *)(iVar12 + 2) = 0;
        }
      }
      else {
        this[0x70] = (CTerrorPlayer)((byte)this[0x70] | 1);
      }
      this[0x39f2] = (CTerrorPlayer)0x0;
    }
    this[0x3a2c] = (CTerrorPlayer)0x0;
    CBaseEntity::SetMoveType((CBaseEntity *)this,2,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)