L L4D2node

CDirector::GetScriptValue

0x00878a40 · 338 bytes · __thiscall

_ZN9CDirector14GetScriptValueEPKcf

Decompiled

undefined (3 params)

/* CDirector::GetScriptValue(char const*, float) */

longdouble __thiscall CDirector::GetScriptValue(CDirector *this,char *param_1,float param_2)

{
  char cVar1;
  char *pcVar2;
  void *local_18;
  undefined4 uStack_14;
  ushort local_10;
  ushort local_e;
  
  if ((*(int *)(this + 0x4b8) == -1) || (g_pScriptVM == (int *)0x0)) goto LAB_00878ae1;
  local_18 = (void *)0x0;
  local_e = 0;
  local_10 = 0;
                    /* try { // try from 00878a8d to 00878ba1 has its CatchHandler @ 00878ba7 */
  cVar1 = (**(code **)(*g_pScriptVM + 0x90))(g_pScriptVM,*(int *)(this + 0x4b8),param_1,&local_18);
  if (cVar1 == '\0') goto LAB_00878ad0;
  switch(local_10) {
  case 0:
    param_2 = 0.0;
    goto LAB_00878ab8;
  case 1:
    param_2 = (float)local_18;
    break;
  default:
    pcVar2 = "unknown_variant_type";
    if (local_10 < 0x29) {
      pcVar2 = *(char **)(CSWTCH_3966 + (uint)local_10 * 4);
    }
    Warning("No conversion from %s to float now\n",pcVar2);
LAB_00878ab8:
    (**(code **)(*g_pScriptVM + 0x9c))(g_pScriptVM,&local_18);
    break;
  case 5:
    param_2 = (float)(int)local_18;
    break;
  case 6:
    param_2 = (float)((uint)local_18 & 0xff) + 0.0;
    break;
  case 0x23:
    param_2 = (float)(double)CONCAT44(uStack_14,local_18);
    break;
  case 0x26:
    param_2 = (float)((uint)local_18 & 0xffff) + (float)((uint)local_18 >> 0x10) * 65536.0;
  }
LAB_00878ad0:
  if ((local_e & 1) != 0) {
    free(local_18);
  }
LAB_00878ae1:
  return (longdouble)param_2;
}

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)