L L4D2node

CFuncElevator::GetFloorForHeight

0x006bd310 · 107 bytes · __thiscall

_ZNK13CFuncElevator17GetFloorForHeightEf

Decompiled

undefined (2 params)

/* CFuncElevator::GetFloorForHeight(float) const */

int __thiscall CFuncElevator::GetFloorForHeight(CFuncElevator *this,float param_1)

{
  int iVar1;
  int iVar2;
  int iVar3;
  float fVar4;
  float fVar5;
  
  if (*(int *)(this + 0x54c) < 1) {
    iVar1 = -1;
  }
  else {
    iVar2 = 0;
    iVar3 = 0;
    fVar5 = 100.0;
    iVar1 = -1;
    do {
      fVar4 = ABS(*(float *)(*(int *)(this + 0x540) + iVar2) - param_1);
      if (fVar4 < fVar5) {
        iVar1 = iVar3;
        fVar5 = fVar4;
      }
      iVar3 = iVar3 + 1;
      iVar2 = iVar2 + 0xc;
    } while (iVar3 != *(int *)(this + 0x54c));
  }
  return iVar1;
}

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)