L L4D2node

CFuncElevator::GetButtonAtCurrentHeight

0x006bd470 · 290 bytes · __cdecl

_ZNK13CFuncElevator24GetButtonAtCurrentHeightEv

Decompiled

undefined (0 params)

/* CFuncElevator::GetButtonAtCurrentHeight() const */

undefined4 * CFuncElevator::GetButtonAtCurrentHeight(void)

{
  float *pfVar1;
  float *pfVar2;
  int *piVar3;
  int iVar4;
  int iVar5;
  undefined4 *puVar6;
  undefined *puVar7;
  float fVar8;
  undefined4 *in_stack_00000004;
  CFuncElevator *in_stack_00000008;
  int *local_28;
  float local_24;
  
  iVar4 = GetCurrentFloor(in_stack_00000008);
  if ((-1 < iVar4) && (iVar4 < *(int *)(in_stack_00000008 + 0x54c))) {
    iVar5 = *(int *)(in_stack_00000008 + 0x540);
    pfVar1 = (float *)(iVar5 + iVar4 * 0xc);
    if (0 < *(int *)(in_stack_00000008 + 0x54c)) {
      iVar4 = 0;
      local_28 = (int *)0x0;
      local_24 = 100.0;
      do {
        pfVar2 = (float *)(iVar5 + iVar4 * 0xc);
        if ((((pfVar1 == pfVar2) || (fVar8 = pfVar2[2], fVar8 == -NAN)) ||
            (puVar7 = g_pEntityList + ((uint)fVar8 & 0xfff) * 0x10,
            puVar7 == (undefined *)0xfffffffc)) ||
           ((*(uint *)(puVar7 + 8) != (uint)fVar8 >> 0xc ||
            (piVar3 = *(int **)(puVar7 + 4), piVar3 == (int *)0x0)))) {
LAB_006bd4d0:
          if (*(int *)(in_stack_00000008 + 0x54c) <= iVar4 + 1) {
LAB_006bd55a:
            *in_stack_00000004 = 0xffffffff;
            if (local_28 == (int *)0x0) {
              return in_stack_00000004;
            }
            puVar6 = (undefined4 *)(**(code **)(*local_28 + 0xc))(local_28);
            *in_stack_00000004 = *puVar6;
            return in_stack_00000004;
          }
        }
        else {
          iVar5 = (**(code **)(*piVar3 + 0x288))(piVar3);
          fVar8 = ABS(*(float *)(iVar5 + 8) - *pfVar1);
          if (local_24 <= fVar8) goto LAB_006bd4d0;
          local_28 = piVar3;
          local_24 = fVar8;
          if (*(int *)(in_stack_00000008 + 0x54c) <= iVar4 + 1) goto LAB_006bd55a;
        }
        iVar4 = iVar4 + 1;
        iVar5 = *(int *)(in_stack_00000008 + 0x540);
      } while( true );
    }
  }
  *in_stack_00000004 = 0xffffffff;
  return in_stack_00000004;
}

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)