CAmbientGeneric::InitModulationParms
0x005dd600 · 658 bytes · __thiscall
_ZN15CAmbientGeneric19InitModulationParmsEv
Decompiled
undefined (1 param)
/* CAmbientGeneric::InitModulationParms() */
void __thiscall CAmbientGeneric::InitModulationParms(CAmbientGeneric *this)
{
int iVar1;
int iVar2;
int iVar3;
int iVar4;
int iVar5;
undefined4 *puVar6;
uint uVar7;
CAmbientGeneric *pCVar8;
int local_18;
int local_14;
iVar2 = *(int *)(this + 0x100) * 10;
if (iVar2 < 0x65) {
iVar4 = 0;
if (-1 < iVar2) {
iVar4 = iVar2;
}
*(int *)(this + 0x460) = iVar4;
}
else {
*(undefined4 *)(this + 0x460) = 100;
}
iVar2 = *(int *)(this + 0x44c);
if ((iVar2 < 0x1c) && (iVar2 != 0)) {
puVar6 = (undefined4 *)(rgdpvpreset + (iVar2 + -1) * 100);
pCVar8 = this + 0x44c;
for (iVar4 = 0x19; iVar4 != 0; iVar4 = iVar4 + -1) {
*(undefined4 *)pCVar8 = *puVar6;
puVar6 = puVar6 + 1;
pCVar8 = pCVar8 + 4;
}
local_14 = *(int *)(this + 0x45c);
if (0 < local_14) {
local_14 = (0x65 - local_14) * 0x40;
*(int *)(this + 0x45c) = local_14;
}
iVar4 = *(int *)(this + 0x458);
if (0 < iVar4) {
iVar4 = (0x65 - iVar4) * 0x40;
*(int *)(this + 0x458) = iVar4;
}
local_18 = *(int *)(this + 0x464) * 10;
*(int *)(this + 0x464) = local_18;
iVar2 = *(int *)(this + 0x468);
iVar3 = *(int *)(this + 0x460) * 10;
*(int *)(this + 0x460) = iVar3;
if (0 < iVar2) {
iVar2 = (0x65 - iVar2) * 0x40;
*(int *)(this + 0x468) = iVar2;
}
iVar5 = *(int *)(this + 0x46c);
if (0 < iVar5) {
iVar5 = (0x65 - iVar5) * 0x40;
}
*(int *)(this + 0x4a0) = iVar5;
*(int *)(this + 0x49c) = iVar2;
*(int *)(this + 0x48c) = iVar4;
uVar7 = *(int *)(this + 0x474) << 8;
*(uint *)(this + 0x474) = uVar7;
*(int *)(this + 0x490) = local_14;
}
else {
local_18 = *(int *)(this + 0x464);
iVar2 = *(int *)(this + 0x49c);
iVar4 = *(int *)(this + 0x48c);
uVar7 = *(uint *)(this + 0x474);
iVar3 = *(int *)(this + 0x460);
}
*(int *)(this + 0x468) = iVar2;
*(undefined4 *)(this + 0x46c) = 0;
if (iVar2 == 0) {
*(int *)(this + 0x498) = iVar3;
}
else {
*(int *)(this + 0x498) = local_18;
iVar3 = local_18;
}
iVar2 = *(int *)(this + 0x454);
*(int *)(this + 0x458) = iVar4;
*(undefined4 *)(this + 0x45c) = 0;
iVar5 = *(int *)(this + 0x450);
if (iVar4 == 0) {
*(int *)(this + 0x488) = iVar5;
}
else {
*(int *)(this + 0x488) = iVar2;
iVar5 = iVar2;
}
if (iVar5 == 0) {
*(undefined4 *)(this + 0x488) = 100;
iVar1 = 0x6400;
iVar5 = 100;
}
else {
iVar1 = iVar5 << 8;
}
*(int *)(this + 0x494) = iVar1;
*(int *)(this + 0x4a4) = iVar3 << 8;
*(undefined4 *)(this + 0x4a8) = 0;
*(uint *)(this + 0x474) = uVar7 ^ (int)uVar7 >> 0x1f;
*(int *)(this + 0x474) = *(int *)(this + 0x474) - ((int)uVar7 >> 0x1f);
*(undefined4 *)(this + 0x484) = 1;
if (*(int *)(this + 0x480) != 0) {
iVar2 = (0xff - iVar2) / *(int *)(this + 0x480) + iVar2;
if (0xff < iVar2) {
iVar2 = 0xff;
}
*(int *)(this + 0x450) = iVar2;
}
if ((((iVar4 != 0) || (*(int *)(this + 0x490) != 0)) ||
((*(int *)(this + 0x470) != 0 && (*(int *)(this + 0x478) != 0)))) && (iVar5 == 100)) {
*(undefined4 *)(this + 0x488) = 0x65;
}
return;
}
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.