L L4D2node

CGameMovement::CheckJumpButton

0x00457dd0 · 766 bytes · __thiscall

_ZN13CGameMovement15CheckJumpButtonEv

Decompiled

undefined (1 param)

/* CGameMovement::CheckJumpButton() */

undefined4 __thiscall CGameMovement::CheckJumpButton(CGameMovement *this)

{
  float *pfVar1;
  float fVar2;
  CBaseEntity *this_00;
  int *piVar3;
  int iVar4;
  int iVar5;
  float fVar6;
  float fVar7;
  
  this_00 = *(CBaseEntity **)(this + 4);
  if (this_00[0x1c80] == (CBaseEntity)0x0) {
    if (*(float *)(this_00 + 0x2010) != 0.0) {
      *(float *)(this_00 + 0x2010) = *(float *)(this_00 + 0x2010) - *(float *)(gpGlobals + 0x10);
      pfVar1 = (float *)(*(int *)(this + 4) + 0x2010);
      if (0.0 < *pfVar1 || *pfVar1 == 0.0) {
        return 0;
      }
      *(undefined4 *)(*(int *)(this + 4) + 0x2010) = 0;
      return 0;
    }
    if (1 < (byte)this_00[0x253]) {
      (**(code **)(*(int *)this + 0x100))(this,0);
      iVar5 = CBaseEntity::GetWaterType(*(CBaseEntity **)(this + 4));
      if (iVar5 == 0x20) {
        *(undefined4 *)(*(int *)(this + 8) + 0x48) = 0x42c80000;
      }
      else {
        iVar5 = CBaseEntity::GetWaterType(*(CBaseEntity **)(this + 4));
        if (iVar5 == 0x10) {
          *(undefined4 *)(*(int *)(this + 8) + 0x48) = 0x42a00000;
        }
      }
      if (0.0 < *(float *)(*(int *)(this + 4) + 0x2024)) {
        return 0;
      }
      *(undefined4 *)(*(int *)(this + 4) + 0x2024) = 0x447a0000;
      (**(code **)(*(int *)this + 0xfc))(this);
      return 0;
    }
    iVar5 = CBaseEntity::GetGroundEntity(this_00);
    if (iVar5 != 0) {
      iVar5 = *(int *)(this + 4);
      if (*(char *)(iVar5 + 0x1c0c) != '\0') {
        return 0;
      }
      if ((*(byte *)(*(int *)(this + 8) + 0x28) & 2) != 0) {
        return 0;
      }
      if ((*(char *)(iVar5 + 0x1a91) != '\0') && ((*(byte *)(iVar5 + 0x150) & 2) != 0)) {
        return 0;
      }
      if (0 < *(int *)(iVar5 + 0x1a98)) {
        return 0;
      }
      (**(code **)(*(int *)this + 0x100))(this,0);
      piVar3 = *(int **)(this + 4);
      (**(code **)(*piVar3 + 0x608))(piVar3,*(int *)(this + 8) + 0x9c,piVar3[0x85f],0x3f800000,1);
      (**(code **)(*IMoveHelper::sm_pSingleton + 0x2c))(IMoveHelper::sm_pSingleton,2);
      iVar5 = *(int *)(this + 4);
      if (*(int *)(iVar5 + 0x217c) == 0) {
        fVar7 = 1.0;
      }
      else {
        fVar7 = *(float *)(*(int *)(iVar5 + 0x217c) + 0x48);
      }
      fVar6 = 268.32816;
      if (g_bMovementOptimizations == '\0') {
        fVar6 = SQRT(*(float *)(sv_gravity._28_4_ + 0x2c) * 42.0);
      }
      iVar4 = *(int *)(this + 8);
      fVar2 = *(float *)(iVar4 + 0x48);
      if ((*(char *)(iVar5 + 0x1a91) == '\0') && ((*(byte *)(iVar5 + 0x150) & 2) == 0)) {
        *(float *)(iVar4 + 0x48) = fVar6 * fVar7 + fVar2;
      }
      else {
        *(float *)(iVar4 + 0x48) = fVar6 * fVar7;
      }
      FinishGravity(this);
      iVar5 = *(int *)(this + 8);
      *(float *)(iVar5 + 0x7c) = (*(float *)(iVar5 + 0x48) + *(float *)(iVar5 + 0x7c)) - fVar2;
      *(float *)(*(int *)(this + 8) + 100) = *(float *)(*(int *)(this + 8) + 100) + 0.15;
      if (*(int *)(gpGlobals + 0x14) == 1) {
        iVar5 = *(int *)(this + 4);
        if (*(int *)(iVar5 + 0x1a9c) != 0x1fe) {
          (**(code **)(*(int *)(iVar5 + 0x1a40) + 4))(iVar5 + 0x1a40,iVar5 + 0x1a9c);
          *(undefined4 *)(iVar5 + 0x1a9c) = 0x1fe;
          iVar5 = *(int *)(this + 4);
        }
        if (*(char *)(iVar5 + 0x1a92) != '\x01') {
          (**(code **)(*(int *)(iVar5 + 0x1a40) + 4))(iVar5 + 0x1a40,iVar5 + 0x1a92);
          *(undefined1 *)(iVar5 + 0x1a92) = 1;
        }
      }
      *(uint *)(*(int *)(this + 8) + 0x28) = *(uint *)(*(int *)(this + 8) + 0x28) | 2;
      return 1;
    }
  }
  *(uint *)(*(int *)(this + 8) + 0x28) = *(uint *)(*(int *)(this + 8) + 0x28) | 2;
  return 0;
}

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)