L L4D2node

CExpressionCalculator::Parse2ArgFunc

0x00270160 · 439 bytes · __thiscall

_ZN21CExpressionCalculator13Parse2ArgFuncERPKc

Decompiled

undefined (2 params)

/* CExpressionCalculator::Parse2ArgFunc(char const*&) */

undefined4 __thiscall
CExpressionCalculator::Parse2ArgFunc(CExpressionCalculator *this,char **param_1)

{
  int iVar1;
  int iVar2;
  char cVar3;
  undefined4 uVar4;
  float *pfVar5;
  bool bVar6;
  longdouble lVar7;
  int local_2c;
  float local_28;
  float local_24;
  float local_20;
  char *local_1c;
  char *local_18;
  char *local_14;
  undefined *local_10;
  
  local_1c = "min";
  local_18 = "max";
  local_14 = "atan2";
  local_10 = &DAT_002cd22d;
  local_2c = 4;
  cVar3 = ParseStringList(param_1,&local_1c,&local_2c);
  if (((((cVar3 == '\0') || (cVar3 = ParseString(param_1,"("), cVar3 == '\0')) ||
       (*param_1 == (char *)0x0)) ||
      ((cVar3 = ParseConditional(this,param_1), cVar3 == '\0' ||
       (cVar3 = ParseString(param_1,","), cVar3 == '\0')))) ||
     ((*param_1 == (char *)0x0 ||
      ((cVar3 = ParseConditional(this,param_1), cVar3 == '\0' ||
       (uVar4 = ParseString(param_1,")"), (char)uVar4 == '\0')))))) {
    return 0;
  }
  iVar2 = *(int *)(this + 0x44);
  iVar1 = iVar2 + -1;
  local_28 = *(float *)(*(int *)(this + 0x38) + iVar1 * 4);
  *(int *)(this + 0x44) = iVar1;
  local_24 = *(float *)(*(int *)(this + 0x38) + -4 + iVar1 * 4);
  *(int *)(this + 0x44) = iVar2 + -2;
  if (local_2c == 1) {
    bVar6 = local_24 < local_28;
  }
  else {
    if (1 < local_2c) {
      if (local_2c == 2) {
        lVar7 = (longdouble)__atan2_finite((double)local_24,(double)local_28);
        local_20 = (float)lVar7;
        pfVar5 = &local_20;
      }
      else {
        if (local_2c != 3) {
          return uVar4;
        }
        lVar7 = (longdouble)__pow_finite((double)local_24,(double)local_28);
        local_20 = (float)lVar7;
        pfVar5 = &local_20;
      }
      goto LAB_002702aa;
    }
    if (local_2c != 0) {
      return uVar4;
    }
    bVar6 = local_28 < local_24;
  }
  pfVar5 = &local_28;
  if (!bVar6 && local_28 != local_24) {
    pfVar5 = &local_24;
  }
LAB_002702aa:
  CUtlStack<float,CUtlMemory<float,int>>::Push
            ((CUtlStack<float,CUtlMemory<float,int>> *)(this + 0x38),pfVar5);
  return uVar4;
}

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)