CCollisionEvent::AddTouchEvent
0x00779750 · 416 bytes · __thiscall
_ZN15CCollisionEvent13AddTouchEventEP11CBaseEntityS1_iRK6VectorS4_.part.176
Decompiled
undefined (6 params)
/* CCollisionEvent::AddTouchEvent(CBaseEntity*, CBaseEntity*, int, Vector const&, Vector const&)
[clone .part.176] */
void __thiscall
CCollisionEvent::AddTouchEvent
(CCollisionEvent *this,CBaseEntity *param_1,CBaseEntity *param_2,int param_3,
Vector *param_4,Vector *param_5)
{
int iVar1;
int in_EAX;
undefined4 *puVar2;
int iVar3;
void *pvVar4;
int iVar5;
undefined4 in_ECX;
undefined4 in_EDX;
int iVar6;
iVar1 = *(int *)(in_EAX + 0xf0);
iVar5 = *(int *)(in_EAX + 0xe8);
iVar6 = iVar1 + 1;
if (iVar5 < iVar6) {
iVar3 = *(int *)(in_EAX + 0xec);
if (-1 < iVar3) {
if (iVar3 == 0) {
if (iVar5 == 0) {
if (iVar6 < 2) {
iVar3 = 1;
goto LAB_0077983f;
}
iVar5 = 1;
}
do {
iVar3 = iVar5 * 2;
if (iVar6 <= iVar3) break;
iVar3 = iVar5 * 4;
iVar5 = iVar3;
} while (iVar3 < iVar6);
}
else {
for (iVar3 = (iVar1 / iVar3 + 1) * iVar3; iVar3 < iVar6; iVar3 = (iVar3 + iVar6) / 2) {
}
}
LAB_0077983f:
*(int *)(in_EAX + 0xe8) = iVar3;
if (*(void **)(in_EAX + 0xe4) == (void *)0x0) {
pvVar4 = malloc(iVar3 * 0x24);
*(void **)(in_EAX + 0xe4) = pvVar4;
}
else {
pvVar4 = realloc(*(void **)(in_EAX + 0xe4),iVar3 * 0x24);
*(void **)(in_EAX + 0xe4) = pvVar4;
iVar6 = *(int *)(in_EAX + 0xf0) + 1;
}
goto LAB_00779781;
}
}
pvVar4 = *(void **)(in_EAX + 0xe4);
LAB_00779781:
*(int *)(in_EAX + 0xf0) = iVar6;
iVar6 = (iVar6 - iVar1) + -1;
*(void **)(in_EAX + 0xf4) = pvVar4;
if (0 < iVar6) {
_V_memmove((void *)((int)pvVar4 + iVar1 * 0x24 + 0x24),(void *)((int)pvVar4 + iVar1 * 0x24),
iVar6 * 0x24);
pvVar4 = *(void **)(in_EAX + 0xe4);
}
puVar2 = (undefined4 *)((int)pvVar4 + iVar1 * 0x24);
puVar2[2] = this;
*puVar2 = in_EDX;
puVar2[1] = in_ECX;
puVar2[3] = *(undefined4 *)param_1;
puVar2[4] = *(undefined4 *)(param_1 + 4);
puVar2[5] = *(undefined4 *)(param_1 + 8);
puVar2[6] = *(undefined4 *)param_2;
puVar2[7] = *(undefined4 *)(param_2 + 4);
puVar2[8] = *(undefined4 *)(param_2 + 8);
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.