TerrorNavMesh::GetInitialCheckpoint
0x0086afe0 · 409 bytes · __thiscall
_ZNK13TerrorNavMesh20GetInitialCheckpointEv
Decompiled
undefined (1 param)
/* TerrorNavMesh::GetInitialCheckpoint() const */
int __thiscall TerrorNavMesh::GetInitialCheckpoint(TerrorNavMesh *this)
{
int iVar1;
char cVar2;
char *pcVar3;
int *piVar4;
float *pfVar5;
int iVar6;
int iVar7;
float fVar8;
float fVar9;
float fVar10;
float fVar11;
cVar2 = CDirector::IsTransitioned(TheDirector);
if (((cVar2 != '\0') && (pcVar3 = (char *)GetTransitionedLandmarkName(), pcVar3 != (char *)0x0))
&& (*pcVar3 != '\0')) {
piVar4 = (int *)CGlobalEntityList::FindEntityByName
((CGlobalEntityList *)gEntList,(CBaseEntity *)0x0,pcVar3,
(CBaseEntity *)0x0,(CBaseEntity *)0x0,(CBaseEntity *)0x0,
(IEntityFindFilter *)0x0);
if (piVar4 == (int *)0x0) {
DevWarning("************\nMost gross danger! Cannot find Landmark named %s!\n************",
pcVar3);
}
else {
pfVar5 = (float *)(**(code **)(*piVar4 + 0x288))(piVar4);
if (0 < *(int *)(this + 0x670)) {
iVar7 = 0;
iVar6 = 0;
fVar11 = 0.0;
do {
iVar1 = *(int *)(*(int *)(this + 0x664) + iVar7 * 4);
fVar10 = (*(float *)(iVar1 + 0x24) + *(float *)(iVar1 + 0x18)) * 0.5;
fVar8 = (*(float *)(iVar1 + 0x28) + *(float *)(iVar1 + 0x1c)) * 0.5;
fVar9 = (*(float *)(iVar1 + 0x2c) + *(float *)(iVar1 + 0x20)) * 0.5;
if (iVar6 == 0) {
fVar10 = *pfVar5 - fVar10;
fVar9 = pfVar5[2] - fVar9;
fVar8 = pfVar5[1] - fVar8;
fVar8 = fVar9 * fVar9 + fVar10 * fVar10 + fVar8 * fVar8;
LAB_0086b112:
iVar6 = iVar1;
fVar11 = fVar8;
}
else {
fVar10 = *pfVar5 - fVar10;
fVar8 = pfVar5[1] - fVar8;
fVar9 = pfVar5[2] - fVar9;
fVar8 = fVar8 * fVar8 + fVar10 * fVar10 + fVar9 * fVar9;
if ((fVar8 < fVar11) && (*(char *)(iVar1 + 0x5f) == '\0')) goto LAB_0086b112;
}
iVar7 = iVar7 + 1;
if (*(int *)(this + 0x670) <= iVar7) {
return iVar6;
}
} while( true );
}
}
}
return 0;
}
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.