L L4D2node

CGameMovement::CanUnduck

0x004543d0 · 576 bytes · __thiscall

_ZN13CGameMovement9CanUnduckEv

Decompiled

undefined (1 param)

/* CGameMovement::CanUnduck() */

bool __thiscall CGameMovement::CanUnduck(CGameMovement *this)

{
  float fVar1;
  float fVar2;
  float fVar3;
  float fVar4;
  float fVar5;
  float fVar6;
  char cVar7;
  code *pcVar8;
  int iVar9;
  int iVar10;
  undefined4 uVar11;
  float local_7c [3];
  undefined1 local_70 [44];
  float local_44;
  char local_39;
  
  iVar9 = *(int *)(this + 8);
  local_7c[0] = *(float *)(iVar9 + 0x9c);
  local_7c[1] = *(float *)(iVar9 + 0xa0);
  local_7c[2] = *(float *)(iVar9 + 0xa4);
  iVar9 = CBaseEntity::GetGroundEntity(*(CBaseEntity **)(this + 4));
  if (iVar9 == 0) {
    iVar9 = (**(code **)(*g_pGameRules + 0x7c))(g_pGameRules);
    iVar10 = (**(code **)(*g_pGameRules + 0x7c))(g_pGameRules);
    fVar1 = *(float *)(iVar10 + 0x18);
    fVar2 = *(float *)(iVar10 + 0x1c);
    fVar3 = *(float *)(iVar10 + 0x20);
    fVar4 = *(float *)(iVar9 + 0xc);
    fVar5 = *(float *)(iVar9 + 0x10);
    fVar6 = *(float *)(iVar9 + 0x14);
    iVar9 = (**(code **)(*g_pGameRules + 0x7c))(g_pGameRules);
    iVar10 = (**(code **)(*g_pGameRules + 0x7c))(g_pGameRules);
    local_7c[0] = local_7c[0] -
                  ((fVar1 - fVar4) - (*(float *)(iVar10 + 0x30) - *(float *)(iVar9 + 0x24)));
    local_7c[1] = local_7c[1] -
                  ((fVar2 - fVar5) - (*(float *)(iVar10 + 0x34) - *(float *)(iVar9 + 0x28)));
    local_7c[2] = local_7c[2] -
                  ((fVar3 - fVar6) - (*(float *)(iVar10 + 0x38) - *(float *)(iVar9 + 0x2c)));
  }
  else {
    iVar9 = 0;
    do {
      iVar10 = (**(code **)(*g_pGameRules + 0x7c))(g_pGameRules);
      fVar1 = *(float *)(iVar10 + 0x24 + iVar9);
      iVar10 = (**(code **)(*g_pGameRules + 0x7c))(g_pGameRules);
      *(float *)((int)local_7c + iVar9) =
           (fVar1 + *(float *)((int)local_7c + iVar9)) - *(float *)(iVar10 + 0xc + iVar9);
      iVar9 = iVar9 + 4;
    } while (iVar9 != 0xc);
  }
  iVar9 = *(int *)(this + 4);
  cVar7 = *(char *)(iVar9 + 0x1a90);
  if (cVar7 != '\0') {
    (**(code **)(*(int *)(iVar9 + 0x1a40) + 4))(iVar9 + 0x1a40,iVar9 + 0x1a90);
    *(undefined1 *)(iVar9 + 0x1a90) = 0;
  }
  pcVar8 = *(code **)(*(int *)this + 0x3c);
  uVar11 = (**(code **)(*(int *)this + 0x40))(this,0,0);
  (*pcVar8)(this,*(int *)(this + 8) + 0x9c,local_7c,uVar11,8,local_70);
  iVar9 = *(int *)(this + 4);
  if (cVar7 != *(char *)(iVar9 + 0x1a90)) {
    (**(code **)(*(int *)(iVar9 + 0x1a40) + 4))(iVar9 + 0x1a40,iVar9 + 0x1a90);
    *(char *)(iVar9 + 0x1a90) = cVar7;
  }
  return local_39 == '\0' && local_44 == 1.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)