NWCEdit::RememberEntityPosition
0x00b5f280 · 303 bytes · __cdecl
_ZN7NWCEdit22RememberEntityPositionEP11CBaseEntity
Decompiled
undefined (1 param)
/* NWCEdit::RememberEntityPosition(CBaseEntity*) */
void NWCEdit::RememberEntityPosition(CBaseEntity *param_1)
{
void *pvVar1;
uint uVar2;
int iVar3;
undefined4 *puVar4;
int iVar5;
uVar2 = (**(code **)(*(int *)param_1 + 0xa4))(param_1);
if ((uVar2 & 0x40000000) != 0) {
if (g_EntityPositions == (void *)0x0) {
g_EntityPositions = operator_new__(0xc000);
g_EntityOrientations = operator_new__(0xc000);
g_EntityClassnames = operator_new__(0x4000);
}
if (*(int *)(param_1 + 0x30) == 0) {
iVar5 = 0;
iVar3 = 0;
}
else {
iVar3 = *(int *)(param_1 + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
iVar5 = iVar3 * 4;
iVar3 = iVar3 * 0xc;
}
if (((byte)param_1[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition(param_1);
}
puVar4 = (undefined4 *)((int)g_EntityPositions + iVar3);
*puVar4 = *(undefined4 *)(param_1 + 0x2e0);
puVar4[1] = *(undefined4 *)(param_1 + 0x2e4);
puVar4[2] = *(undefined4 *)(param_1 + 0x2e8);
if (((byte)param_1[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition(param_1);
}
puVar4 = (undefined4 *)(iVar3 + (int)g_EntityOrientations);
*puVar4 = *(undefined4 *)(param_1 + 0x37c);
pvVar1 = g_EntityClassnames;
puVar4[1] = *(undefined4 *)(param_1 + 0x380);
puVar4[2] = *(undefined4 *)(param_1 + 900);
*(undefined4 *)((int)pvVar1 + iVar5) = *(undefined4 *)(param_1 + 0x7c);
}
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.