CSmokeStack::KeyValue
0x00825a40 · 622 bytes · __thiscall
_ZN11CSmokeStack8KeyValueEPKcS1_.part.26
Decompiled
undefined (3 params)
/* CSmokeStack::KeyValue(char const*, char const*) [clone .part.26] */
undefined4 __thiscall CSmokeStack::KeyValue(CSmokeStack *this,char *param_1,char *param_2)
{
CBaseEdict *this_00;
code *pcVar1;
char cVar2;
CBaseEntity *in_EAX;
int iVar3;
int iVar4;
undefined4 uVar5;
long lVar6;
char *in_ECX;
char *in_EDX;
char *pcVar7;
int in_GS_OFFSET;
undefined4 local_430 [3];
char acStack_421 [513];
char local_220 [512];
int local_20;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
iVar3 = _V_stricmp(in_EDX,"WindSpeed");
if (iVar3 == 0) {
lVar6 = strtol(in_ECX,(char **)0x0,10);
*(long *)(in_EAX + 0x4b4) = lVar6;
RecalcWindVector((CSmokeStack *)in_EAX);
uVar5 = 1;
}
else {
iVar3 = _V_stricmp(in_EDX,"SmokeMaterial");
if (iVar3 == 0) {
iVar3 = V_stristr(in_ECX,".vmt");
if (iVar3 == 0) {
V_snprintf(local_220,0x200,"%s.vmt");
AllocPooledString((char *)local_430);
*(undefined4 *)(in_EAX + 0x4a8) = local_430[0];
}
else {
AllocPooledString((char *)local_430);
*(undefined4 *)(in_EAX + 0x4a8) = local_430[0];
}
pcVar7 = "";
if (*(char **)(in_EAX + 0x4a8) != (char *)0x0) {
pcVar7 = *(char **)(in_EAX + 0x4a8);
}
iVar3 = CBaseEntity::PrecacheModel(pcVar7);
if (iVar3 != *(int *)(in_EAX + 0x4ac)) {
if (in_EAX[0x6c] == (CBaseEntity)0x0) {
this_00 = *(CBaseEdict **)(in_EAX + 0x30);
if (this_00 != (CBaseEdict *)0x0) {
*(uint *)this_00 = *(uint *)this_00 | 0x101;
iVar4 = CBaseEdict::GetChangeAccessor(this_00);
*(undefined2 *)(iVar4 + 2) = 0;
}
}
else {
in_EAX[0x70] = (CBaseEntity)((byte)in_EAX[0x70] | 1);
}
*(int *)(in_EAX + 0x4ac) = iVar3;
}
iVar4 = 1;
V_StripExtension(pcVar7,acStack_421 + 1,0x200);
iVar3 = _V_strlen(acStack_421 + 1);
acStack_421[iVar3] = '\0';
V_snprintf(local_220,0x200,"%s%d.vmt",acStack_421 + 1,1);
while( true ) {
pcVar1 = *(code **)(*(int *)(filesystem + 4) + 0x28);
uVar5 = UTIL_VarArgs("materials/%s",local_220);
cVar2 = (*pcVar1)(filesystem + 4,uVar5,0);
if (cVar2 == '\0') break;
iVar4 = iVar4 + 1;
CBaseEntity::PrecacheModel(local_220);
V_snprintf(local_220,0x200,"%s%d.vmt",acStack_421 + 1,iVar4);
}
uVar5 = 1;
}
else {
uVar5 = CBaseEntity::KeyValue(in_EAX,in_EDX,in_ECX);
}
}
if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
return uVar5;
}
/* WARNING: Subroutine does not return */
__stack_chk_fail();
}
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.