CBasePlayer::ReplaceContextCommands
0x007ba070 · 139 bytes · __thiscall
_ZN11CBasePlayer22ReplaceContextCommandsEP15CCommandContextP8CUserCmdi
Decompiled
undefined (4 params)
/* CBasePlayer::ReplaceContextCommands(CCommandContext*, CUserCmd*, int) */
void __thiscall
CBasePlayer::ReplaceContextCommands
(CBasePlayer *this,CCommandContext *param_1,CUserCmd *param_2,int param_3)
{
undefined4 *puVar1;
int iVar2;
int iVar3;
CUserCmd *pCVar4;
iVar2 = *(int *)(param_1 + 0xc) + -1;
iVar3 = iVar2 * 0x58;
if (-1 < iVar2) {
do {
iVar2 = iVar2 + -1;
puVar1 = (undefined4 *)(*(int *)param_1 + iVar3);
iVar3 = iVar3 + -0x58;
(**(code **)*puVar1)(puVar1);
} while (iVar2 != -1);
}
*(undefined4 *)(param_1 + 0xc) = 0;
*(undefined4 *)(param_1 + 0x1c) = 0;
*(int *)(param_1 + 0x14) = param_3;
iVar2 = param_3 + -1;
*(int *)(param_1 + 0x18) = param_3;
if (-1 < iVar2) {
iVar3 = 0;
pCVar4 = param_2 + iVar2 * 0x58;
while( true ) {
iVar2 = iVar2 + -1;
CUtlVector<CUserCmd,CUtlMemory<CUserCmd,int>>::InsertBefore
((CUtlVector<CUserCmd,CUtlMemory<CUserCmd,int>> *)param_1,iVar3,pCVar4);
if (iVar2 == -1) break;
iVar3 = *(int *)(param_1 + 0xc);
pCVar4 = pCVar4 + -0x58;
}
}
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.