Checkpoint::FindInterestingLookAtTarget
0x0086a9a0 · 371 bytes · __cdecl
_ZNK10Checkpoint27FindInterestingLookAtTargetERK6Vector
Decompiled
undefined (1 param)
/* Checkpoint::FindInterestingLookAtTarget(Vector const&) const */
Vector * Checkpoint::FindInterestingLookAtTarget(Vector *param_1)
{
int *piVar1;
undefined4 uVar2;
int iVar3;
float *pfVar4;
char *pcVar5;
undefined4 *puVar6;
int iVar7;
float *in_stack_0000000c;
int *local_24;
float local_20;
if (0 < DAT_0100486c) {
local_24 = (int *)0x0;
iVar7 = 0;
local_20 = 10000.0;
do {
piVar1 = *(int **)(TheWeaponSpawns + iVar7 * 4);
pcVar5 = (char *)piVar1[0x1f];
if (pcVar5 == (char *)0x0) {
pcVar5 = "";
LAB_0086a9df:
iVar3 = _V_stricmp("weapon_ammo_spawn",pcVar5);
if (iVar3 != 0) {
pfVar4 = (float *)(**(code **)(*piVar1 + 0x288))(piVar1);
if ((pfVar4[2] - in_stack_0000000c[2]) * (pfVar4[2] - in_stack_0000000c[2]) +
(pfVar4[1] - in_stack_0000000c[1]) * (pfVar4[1] - in_stack_0000000c[1]) +
(*pfVar4 - *in_stack_0000000c) * (*pfVar4 - *in_stack_0000000c) < local_20 * local_20)
{
pfVar4 = (float *)(**(code **)(*piVar1 + 0x288))(piVar1);
local_20 = SQRT((pfVar4[1] - in_stack_0000000c[1]) * (pfVar4[1] - in_stack_0000000c[1])
+ (*pfVar4 - *in_stack_0000000c) * (*pfVar4 - *in_stack_0000000c) +
(pfVar4[2] - in_stack_0000000c[2]) * (pfVar4[2] - in_stack_0000000c[2]))
;
local_24 = piVar1;
}
}
}
else if (pcVar5 != "weapon_ammo_spawn") goto LAB_0086a9df;
iVar7 = iVar7 + 1;
} while (iVar7 < DAT_0100486c);
if (local_24 != (int *)0x0) {
puVar6 = (undefined4 *)(**(code **)(*local_24 + 0x288))(local_24);
*(undefined4 *)param_1 = *puVar6;
uVar2 = puVar6[2];
*(undefined4 *)(param_1 + 4) = puVar6[1];
*(undefined4 *)(param_1 + 8) = uVar2;
return param_1;
}
}
*(undefined4 *)param_1 = vec3_origin;
*(undefined4 *)(param_1 + 4) = DAT_01053d4c;
*(undefined4 *)(param_1 + 8) = DAT_01053d50;
return param_1;
}
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.