CPhysicsPushedEntities::AddEntity
0x0078bdf0 · 327 bytes · __thiscall
_ZN22CPhysicsPushedEntities9AddEntityEP11CBaseEntity
Decompiled
undefined (2 params)
/* CPhysicsPushedEntities::AddEntity(CBaseEntity*) */
void __thiscall CPhysicsPushedEntities::AddEntity(CPhysicsPushedEntities *this,CBaseEntity *param_1)
{
int iVar1;
void *pvVar2;
int iVar3;
int iVar4;
int iVar5;
iVar5 = *(int *)(this + 0x24);
iVar3 = *(int *)(this + 0x1c);
iVar4 = iVar5 + 1;
if (iVar3 < iVar4) {
iVar1 = *(int *)(this + 0x20);
if (-1 < iVar1) {
if (iVar1 == 0) {
if (iVar3 == 0) {
if (iVar4 < 2) {
iVar1 = 1;
goto LAB_0078bed7;
}
iVar3 = 1;
}
do {
iVar1 = iVar3 * 2;
if (iVar4 <= iVar1) break;
iVar1 = iVar3 * 4;
iVar3 = iVar1;
} while (iVar1 < iVar4);
}
else {
for (iVar1 = (iVar5 / iVar1 + 1) * iVar1; iVar1 < iVar4; iVar1 = (iVar1 + iVar4) / 2) {
}
}
LAB_0078bed7:
*(int *)(this + 0x1c) = iVar1;
if (*(void **)(this + 0x18) == (void *)0x0) {
pvVar2 = malloc(iVar1 * 0x68);
*(void **)(this + 0x18) = pvVar2;
}
else {
pvVar2 = realloc(*(void **)(this + 0x18),iVar1 * 0x68);
*(void **)(this + 0x18) = pvVar2;
iVar4 = *(int *)(this + 0x24) + 1;
}
goto LAB_0078be13;
}
}
pvVar2 = *(void **)(this + 0x18);
LAB_0078be13:
*(int *)(this + 0x24) = iVar4;
iVar4 = (iVar4 - iVar5) + -1;
iVar5 = iVar5 * 0x68;
*(void **)(this + 0x28) = pvVar2;
if (0 < iVar4) {
_V_memmove((void *)((int)pvVar2 + iVar5 + 0x68),(void *)((int)pvVar2 + iVar5),iVar4 * 0x68);
pvVar2 = *(void **)(this + 0x18);
}
*(CBaseEntity **)((int)pvVar2 + iVar5) = param_1;
if (((byte)param_1[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition(param_1);
}
iVar5 = *(int *)(this + 0x18) + iVar5;
*(undefined4 *)(iVar5 + 4) = *(undefined4 *)(param_1 + 0x2e0);
*(undefined4 *)(iVar5 + 8) = *(undefined4 *)(param_1 + 0x2e4);
*(undefined4 *)(iVar5 + 0xc) = *(undefined4 *)(param_1 + 0x2e8);
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.