L L4D2node

CBaseFlex::GetFlexWeight

0x006244a0 · 187 bytes · __thiscall

_ZN9CBaseFlex13GetFlexWeightE21LocalFlexController_t

Decompiled

undefined (2 params)

/* CBaseFlex::GetFlexWeight(LocalFlexController_t) */

longdouble __thiscall CBaseFlex::GetFlexWeight(CBaseFlex *this,int param_2)

{
  float fVar1;
  float fVar2;
  int iVar3;
  int *piVar4;
  
  if (-1 < param_2) {
    iVar3 = CBaseAnimating::GetNumFlexControllers((CBaseAnimating *)this);
    if (param_2 < iVar3) {
      piVar4 = *(int **)(this + 0x13e0);
      if (piVar4 == (int *)0x0) {
        iVar3 = CBaseEntity::GetModel((CBaseEntity *)this);
        if (iVar3 == 0) {
          piVar4 = *(int **)(this + 0x13e0);
        }
        else {
          CBaseAnimating::LockStudioHdr((CBaseAnimating *)this);
          piVar4 = *(int **)(this + 0x13e0);
        }
        if (piVar4 == (int *)0x0) goto LAB_00624520;
      }
      iVar3 = *piVar4;
      if (iVar3 != 0) {
        iVar3 = iVar3 + *(int *)(iVar3 + 0x110) + param_2 * 0x14;
        fVar1 = *(float *)(iVar3 + 0x10);
        fVar2 = *(float *)(iVar3 + 0xc);
        if (fVar1 == fVar2) {
          return (longdouble)*(float *)(this + param_2 * 4 + 0x15f8);
        }
        return (longdouble)(*(float *)(this + param_2 * 4 + 0x15f8) * (fVar1 - fVar2) + fVar2);
      }
    }
  }
LAB_00624520:
  return (longdouble)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)