CTerrorPlayer::TryGetPathableLocationWithin
0x009b8dd0 · 609 bytes · __cdecl
_ZN13CTerrorPlayer28TryGetPathableLocationWithinEf
Decompiled
undefined (1 param)
/* CTerrorPlayer::TryGetPathableLocationWithin(float) */
float CTerrorPlayer::TryGetPathableLocationWithin(float param_1)
{
float fVar1;
float fVar2;
undefined4 uVar3;
CBaseEntity CVar4;
CNavArea *pCVar5;
bool bVar6;
CNavArea *pCVar7;
int iVar8;
int iVar9;
float fVar10;
CBaseEntity *in_stack_00000008;
float in_stack_0000000c;
undefined4 local_40;
float local_3c;
float local_38;
float local_30;
ShortestPathCost local_21;
CNavArea *local_20 [4];
if ((0.0 <= in_stack_0000000c) && (*(char *)(TheNavMesh + 0x4c) != '\0')) {
pCVar7 = (CNavArea *)(**(code **)(*(int *)in_stack_00000008 + 0x52c))();
local_20[0] = (CNavArea *)0x0;
iVar8 = *(int *)(in_stack_00000008 + 0x30f4);
if (iVar8 != 0) {
iVar9 = 5;
local_30 = 0.0;
local_38 = vec3_origin;
local_40 = DAT_01053d50;
local_3c = DAT_01053d4c;
while( true ) {
iVar8 = RandomInt(0,iVar8 + -1);
pCVar5 = *(CNavArea **)(*(int *)(in_stack_00000008 + 0x30e8) + iVar8 * 4);
bVar6 = NavAreaBuildPath<ShortestPathCost>
(pCVar7,pCVar5,(Vector *)0x0,(Vector *)0x0,&local_21,local_20,
in_stack_0000000c,2,false);
if (bVar6) {
CVar4 = in_stack_00000008[0x14d];
fVar1 = *(float *)(pCVar5 + 0x2c);
fVar2 = *(float *)(pCVar5 + 0x30);
uVar3 = *(undefined4 *)(pCVar5 + 0x34);
}
else {
CVar4 = in_stack_00000008[0x14d];
fVar1 = *(float *)(local_20[0] + 0x2c);
fVar2 = *(float *)(local_20[0] + 0x30);
uVar3 = *(undefined4 *)(local_20[0] + 0x34);
}
if (((byte)CVar4 & 8) != 0) {
CBaseEntity::CalcAbsolutePosition(in_stack_00000008);
}
fVar10 = (fVar1 - *(float *)(in_stack_00000008 + 0x2e0)) *
(fVar1 - *(float *)(in_stack_00000008 + 0x2e0)) +
(fVar2 - *(float *)(in_stack_00000008 + 0x2e4)) *
(fVar2 - *(float *)(in_stack_00000008 + 0x2e4));
if ((local_30 < fVar10) &&
(local_40 = uVar3, local_3c = fVar2, local_38 = fVar1, local_30 = fVar10,
((byte)in_stack_00000008[0x14d] & 8) != 0)) {
CBaseEntity::CalcAbsolutePosition(in_stack_00000008);
local_30 = (fVar2 - *(float *)(in_stack_00000008 + 0x2e4)) *
(fVar2 - *(float *)(in_stack_00000008 + 0x2e4)) +
(fVar1 - *(float *)(in_stack_00000008 + 0x2e0)) *
(fVar1 - *(float *)(in_stack_00000008 + 0x2e0));
}
iVar9 = iVar9 + -1;
if (iVar9 == 0) break;
iVar8 = *(int *)(in_stack_00000008 + 0x30f4);
}
*(float *)param_1 = local_38;
*(float *)((int)param_1 + 4) = local_3c;
*(undefined4 *)((int)param_1 + 8) = local_40;
return param_1;
}
}
*(float *)param_1 = vec3_origin;
*(float *)((int)param_1 + 4) = DAT_01053d4c;
*(undefined4 *)((int)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.