CBaseCombatCharacter::FindEntityRelationship
0x005f46a0 · 323 bytes · __thiscall
_ZN20CBaseCombatCharacter22FindEntityRelationshipEP11CBaseEntity
Decompiled
undefined (2 params)
/* CBaseCombatCharacter::FindEntityRelationship(CBaseEntity*) */
uint * __thiscall
CBaseCombatCharacter::FindEntityRelationship(CBaseCombatCharacter *this,CBaseEntity *param_1)
{
uint uVar1;
int iVar2;
int iVar3;
uint *puVar4;
undefined *puVar5;
if (param_1 == (CBaseEntity *)0x0) {
if ((FindEntityRelationship(CBaseEntity*)::dummy == '\0') &&
(iVar3 = __cxa_guard_acquire(&FindEntityRelationship(CBaseEntity*)::dummy), iVar3 != 0)) {
FindEntityRelationship(CBaseEntity*)::dummy._0_4_ = 0xffffffff;
__cxa_guard_release(&FindEntityRelationship(CBaseEntity*)::dummy);
}
return (uint *)FindEntityRelationship(CBaseEntity*)::dummy;
}
if (0 < *(int *)(this + 0x1854)) {
iVar3 = 0;
puVar4 = *(uint **)(this + 0x1848);
do {
uVar1 = *puVar4;
if ((((uVar1 != 0xffffffff) &&
(puVar5 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar5 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar5 + 8) == uVar1 >> 0xc)) && (param_1 == *(CBaseEntity **)(puVar5 + 4))) {
return puVar4;
}
iVar3 = iVar3 + 1;
puVar4 = puVar4 + 4;
} while (iVar3 != *(int *)(this + 0x1854));
}
iVar3 = (**(code **)(*(int *)param_1 + 0x100))(param_1);
if ((iVar3 != 0) && (0 < *(int *)(this + 0x1854))) {
iVar3 = 0;
do {
uVar1 = (**(code **)(*(int *)param_1 + 0x100))(param_1);
puVar4 = (uint *)(iVar3 * 0x10 + *(int *)(this + 0x1848));
if (uVar1 == puVar4[1]) {
return puVar4;
}
iVar3 = iVar3 + 1;
} while (iVar3 < *(int *)(this + 0x1854));
}
AllocateDefaultRelationships();
iVar3 = m_DefaultRelationship;
iVar2 = (**(code **)(*(int *)this + 0x100))(this);
iVar3 = *(int *)(iVar3 + iVar2 * 4);
iVar2 = (**(code **)(*(int *)param_1 + 0x100))(param_1);
return (uint *)(iVar2 * 0x10 + iVar3);
}
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.