L L4D2node

CFuncElevator::GetCurrentFloor

0x006bd3e0 · 118 bytes · __thiscall

_ZNK13CFuncElevator15GetCurrentFloorEv

Decompiled

undefined (1 param)

/* CFuncElevator::GetCurrentFloor() const */

int __thiscall CFuncElevator::GetCurrentFloor(CFuncElevator *this)

{
  int iVar1;
  int iVar2;
  
  if (((byte)this[0x14d] & 8) != 0) {
    CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
  }
  if (0 < *(int *)(this + 0x54c)) {
    iVar2 = 0;
    iVar1 = 0;
    do {
      if (ABS(*(float *)(this + 0x2e8) - *(float *)(*(int *)(this + 0x540) + iVar2)) < 0.5) {
        return iVar1;
      }
      iVar1 = iVar1 + 1;
      iVar2 = iVar2 + 0xc;
    } while (iVar1 != *(int *)(this + 0x54c));
  }
  return -1;
}

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)