CDirector::GetScriptValue
0x0087a3e0 · 258 bytes · __thiscall
_ZN9CDirector14GetScriptValueEPKci
Decompiled
undefined (3 params)
/* CDirector::GetScriptValue(char const*, int) */
char * __thiscall CDirector::GetScriptValue(CDirector *this,char *param_1,int param_2)
{
char cVar1;
char *pcVar2;
char *local_28 [2];
ushort local_20;
ushort local_1e;
if (*(int *)(this + 0x4b8) == -1) {
return (char *)param_2;
}
if (g_pScriptVM == (int *)0x0) {
return (char *)param_2;
}
local_28[0] = (char *)0x0;
local_1e = 0;
local_20 = 0;
/* try { // try from 0087a431 to 0087a501 has its CatchHandler @ 0087a507 */
cVar1 = (**(code **)(*g_pScriptVM + 0x90))(g_pScriptVM,*(int *)(this + 0x4b8),param_1,local_28);
if (cVar1 == '\0') goto LAB_0087a470;
switch(local_20) {
case 0:
param_2 = 0;
goto LAB_0087a45a;
case 1:
param_2 = (int)(float)local_28[0];
break;
default:
pcVar2 = "unknown_variant_type";
if (local_20 < 0x29) {
pcVar2 = *(char **)(CSWTCH_3966 + (uint)local_20 * 4);
}
Warning("No conversion from %s to int now\n",pcVar2);
LAB_0087a45a:
(**(code **)(*g_pScriptVM + 0x9c))(g_pScriptVM,local_28);
break;
case 5:
case 0x26:
param_2 = (int)local_28[0];
break;
case 6:
param_2 = (uint)local_28[0] & 0xff;
break;
case 0x1f:
param_2 = strtol(local_28[0],(char **)0x0,10);
}
LAB_0087a470:
if ((local_1e & 1) != 0) {
free(local_28[0]);
}
return (char *)param_2;
}
SourceMod gamedata
paste intoaddons/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.
Signatures + Functions block. The plugin uses
DHookCreateFromConf - DHooks reads return type, this-type,
calling convention, and argument types straight from the gamedata. Less
boilerplate in the plugin, types travel with the gamedata.
Gamedata KeyValues
DHooks plugin example
Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.