L L4D2node

CFlexCycler::SetFlexTarget

0x006270c0 · 270 bytes · __thiscall

_ZN11CFlexCycler13SetFlexTargetE21LocalFlexController_t

Decompiled

undefined (2 params)

/* CFlexCycler::SetFlexTarget(LocalFlexController_t) */

void __thiscall CFlexCycler::SetFlexTarget(CFlexCycler *this,int param_2)

{
  char *pcVar1;
  int iVar2;
  char *pcVar3;
  int iVar4;
  undefined1 uVar5;
  byte bVar6;
  longdouble lVar7;
  
  bVar6 = 0;
  iVar4 = 0;
  lVar7 = (longdouble)(**(code **)(*random_valve + 4))(random_valve,0x3f000000,0x3f800000);
  *(float *)(this + param_2 * 4 + 0x17e0) = (float)lVar7;
  pcVar1 = (char *)CBaseAnimating::GetFlexControllerType((CBaseAnimating *)this,param_2);
  while( true ) {
    iVar2 = CBaseAnimating::GetNumFlexControllers((CBaseAnimating *)this);
    uVar5 = iVar4 == iVar2;
    if (iVar2 <= iVar4) break;
    if (param_2 != iVar4) {
      pcVar3 = (char *)CBaseAnimating::GetFlexControllerType((CBaseAnimating *)this,iVar4);
      iVar2 = _V_stricmp(pcVar1,pcVar3);
      if (iVar2 == 0) {
        *(undefined4 *)(this + iVar4 * 4 + 0x17e0) = 0;
      }
    }
    iVar4 = iVar4 + 1;
  }
  pcVar3 = (char *)CBaseAnimating::GetFlexControllerName((CBaseAnimating *)this,param_2);
  iVar4 = 6;
  pcVar1 = "right_";
  do {
    if (iVar4 == 0) break;
    iVar4 = iVar4 + -1;
    uVar5 = *pcVar1 == *pcVar3;
    pcVar1 = pcVar1 + (uint)bVar6 * -2 + 1;
    pcVar3 = pcVar3 + (uint)bVar6 * -2 + 1;
  } while ((bool)uVar5);
  if ((bool)uVar5) {
    *(undefined4 *)(this + param_2 * 4 + 0x17e4) = *(undefined4 *)(this + param_2 * 4 + 0x17e0);
  }
  else {
    pcVar3 = (char *)CBaseAnimating::GetFlexControllerName((CBaseAnimating *)this,param_2);
    iVar4 = 5;
    pcVar1 = "left_";
    do {
      if (iVar4 == 0) break;
      iVar4 = iVar4 + -1;
      uVar5 = *pcVar1 == *pcVar3;
      pcVar1 = pcVar1 + (uint)bVar6 * -2 + 1;
      pcVar3 = pcVar3 + (uint)bVar6 * -2 + 1;
    } while ((bool)uVar5);
    if ((bool)uVar5) {
      *(undefined4 *)(this + param_2 * 4 + 0x17dc) = *(undefined4 *)(this + param_2 * 4 + 0x17e0);
      return;
    }
  }
  return;
}

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)