CBreakable::KeyValue
0x006b2360 · 530 bytes · __thiscall
_ZN10CBreakable8KeyValueEPKcS1_
Decompiled
undefined (3 params)
/* CBreakable::KeyValue(char const*, char const*) */
undefined4 __thiscall CBreakable::KeyValue(CBreakable *this,char *param_1,char *param_2)
{
char *pcVar1;
int iVar2;
undefined4 uVar3;
uint uVar4;
long lVar5;
uint uVar6;
char *pcVar7;
undefined4 local_20 [4];
if ((param_1 == "material") || (iVar2 = _V_stricmp(param_1,"material"), iVar2 == 0)) {
uVar4 = strtol(param_2,(char **)0x0,10);
uVar6 = 1;
if (uVar4 < 0xb) {
uVar6 = uVar4;
}
*(uint *)(this + 0x44c) = uVar6;
return 1;
}
if (param_1 == "deadmodel") {
return 1;
}
iVar2 = _V_stricmp(param_1,"deadmodel");
if (iVar2 == 0) {
return 1;
}
if (param_1 == "shards") {
return 1;
}
iVar2 = _V_stricmp(param_1,"shards");
if (iVar2 == 0) {
return 1;
}
if ((param_1 == "gibmodel") || (iVar2 = _V_stricmp(param_1,"gibmodel"), iVar2 == 0)) {
AllocPooledString((char *)local_20);
*(undefined4 *)(this + 0x464) = local_20[0];
return 1;
}
if ((param_1 != "spawnobject") && (iVar2 = _V_stricmp(param_1,"spawnobject"), iVar2 != 0)) {
if ((param_1 == "propdata") || (iVar2 = _V_stricmp(param_1,"propdata"), iVar2 == 0)) {
uVar6 = strtol(param_2,(char **)0x0,10);
if ((int)uVar6 < 1) {
if (uVar6 == 0) {
return 1;
}
}
else if (uVar6 < 0x1a) {
pcVar1 = *(char **)(pFGDPropData + uVar6 * 4);
pcVar7 = (char *)0x0;
if ((pcVar1 != (char *)0x0) && (*pcVar1 != '\0')) {
pcVar7 = pcVar1;
}
*(char **)(this + 0x480) = pcVar7;
return 1;
}
Warning("func_breakable with invalid propdata %d.\n",uVar6);
return 1;
}
if (param_1 == "lip") {
return 1;
}
iVar2 = _V_stricmp(param_1,"lip");
if (iVar2 == 0) {
return 1;
}
uVar3 = CBaseEntity::KeyValue((CBaseEntity *)this,param_1,param_2);
return uVar3;
}
lVar5 = strtol(param_2,(char **)0x0,10);
if (0x19 < lVar5 - 1U) {
return 1;
}
pcVar1 = (char *)(&pSpawnObjects)[lVar5];
pcVar7 = (char *)0x0;
if ((pcVar1 != (char *)0x0) && (*pcVar1 != '\0')) {
pcVar7 = pcVar1;
}
*(char **)(this + 0x468) = pcVar7;
return 1;
}
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.