CSoundParametersInternal::CopyFrom
0x00598d10 · 332 bytes · __thiscall
_ZN24CSoundParametersInternal8CopyFromERKS_
Decompiled
undefined (2 params)
/* CSoundParametersInternal::CopyFrom(CSoundParametersInternal const&) */
void __thiscall
CSoundParametersInternal::CopyFrom(CSoundParametersInternal *this,CSoundParametersInternal *param_1)
{
CSoundParametersInternal CVar1;
CSoundParametersInternal CVar2;
ushort uVar3;
void *pvVar4;
if (1 < *(ushort *)(this + 8)) {
free(*(void **)this);
}
if (1 < *(ushort *)(this + 10)) {
free(*(void **)(this + 4));
}
*(undefined2 *)(this + 0x16) = *(undefined2 *)(param_1 + 0x16);
*(undefined4 *)(this + 0xc) = *(undefined4 *)(param_1 + 0xc);
*(undefined2 *)(this + 0x14) = *(undefined2 *)(param_1 + 0x14);
*(undefined4 *)(this + 0x10) = *(undefined4 *)(param_1 + 0x10);
*(undefined2 *)(this + 0x18) = *(undefined2 *)(param_1 + 0x18);
this[0x1a] = (CSoundParametersInternal)((byte)this[0x1a] & 0xfe | (byte)param_1[0x1a] & 1);
uVar3 = *(ushort *)(param_1 + 8);
*(ushort *)(this + 8) = uVar3;
if (uVar3 == 0) {
*(undefined4 *)this = 0;
}
else {
if (1 < uVar3) {
pvVar4 = malloc((uint)uVar3 * 4);
*(void **)this = pvVar4;
memcpy(pvVar4,*(void **)param_1,(uint)uVar3 * 4);
uVar3 = *(ushort *)(param_1 + 10);
*(ushort *)(this + 10) = uVar3;
goto joined_r0x00598e21;
}
*(undefined4 *)this = *(undefined4 *)param_1;
}
uVar3 = *(ushort *)(param_1 + 10);
*(ushort *)(this + 10) = uVar3;
joined_r0x00598e21:
if (uVar3 == 0) {
*(undefined4 *)(this + 4) = 0;
}
else if (uVar3 < 2) {
*(undefined4 *)(this + 4) = *(undefined4 *)(param_1 + 4);
}
else {
pvVar4 = malloc((uint)uVar3 * 4);
*(void **)(this + 4) = pvVar4;
memcpy(pvVar4,*(void **)(param_1 + 4),(uint)uVar3 * 4);
}
if (*(KeyValues **)(param_1 + 0x1c) != (KeyValues *)0x0) {
SetGameData(this,*(KeyValues **)(param_1 + 0x1c));
}
CVar1 = param_1[0x1a];
CVar2 = this[0x1a];
this[0x1a] = (CSoundParametersInternal)((byte)CVar2 & 0xfd | (byte)CVar1 & 2);
this[0x1a] = (CSoundParametersInternal)
((byte)CVar2 & 0xf9 | (byte)CVar1 & 2 | (byte)param_1[0x1a] & 4);
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.