CAI_BehaviorBase::StartChannel
0x005a6d60 · 170 bytes · __thiscall
_ZN16CAI_BehaviorBase12StartChannelEi
Decompiled
undefined (2 params)
/* CAI_BehaviorBase::StartChannel(int) */
void __thiscall CAI_BehaviorBase::StartChannel(CAI_BehaviorBase *this,int param_1)
{
int iVar1;
int iVar2;
int iVar3;
int iVar4;
int iVar5;
undefined4 *puVar6;
byte bVar7;
bVar7 = 0;
if (-1 < param_1) {
iVar4 = *(int *)(this + 0x18);
if ((iVar4 < param_1 + 1) && (iVar1 = (param_1 + 1) - iVar4, iVar1 != 0)) {
CUtlVector<AIChannelScheduleState_t,CUtlMemory<AIChannelScheduleState_t,int>>::GrowVector
((CUtlVector<AIChannelScheduleState_t,CUtlMemory<AIChannelScheduleState_t,int>> *)
(this + 0xc),iVar1);
CUtlVector<AIChannelScheduleState_t,CUtlMemory<AIChannelScheduleState_t,int>>::
ShiftElementsRight((CUtlVector<AIChannelScheduleState_t,CUtlMemory<AIChannelScheduleState_t,int>>
*)(this + 0xc),iVar4,iVar1);
iVar3 = *(int *)(this + 0xc);
if (0 < iVar1) {
iVar4 = iVar4 * 0x28;
iVar5 = 0;
do {
if ((undefined4 *)(iVar3 + iVar4) != (undefined4 *)0x0) {
puVar6 = (undefined4 *)(iVar3 + iVar4);
for (iVar2 = 10; iVar2 != 0; iVar2 = iVar2 + -1) {
*puVar6 = 0;
puVar6 = puVar6 + (uint)bVar7 * -2 + 1;
}
iVar3 = *(int *)(this + 0xc);
}
iVar5 = iVar5 + 1;
iVar4 = iVar4 + 0x28;
} while (iVar5 != iVar1);
}
}
else {
iVar3 = *(int *)(this + 0xc);
}
*(undefined1 *)(iVar3 + param_1 * 0x28) = 1;
}
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.