CFuncTrackTrain::Find
0x00b10ec0 · 629 bytes · __thiscall
_ZN15CFuncTrackTrain4FindEv
Decompiled
undefined (1 param)
/* CFuncTrackTrain::Find() */
void __thiscall CFuncTrackTrain::Find(CFuncTrackTrain *this)
{
char cVar1;
char *pcVar2;
CBaseEntity *this_00;
undefined1 local_44 [8];
float local_3c;
float local_38;
float local_34;
float local_30;
float local_2c;
float local_28;
undefined4 local_24;
undefined4 local_20;
undefined4 local_1c;
float local_18;
float local_14;
float local_10;
pcVar2 = "";
if (*(char **)(this + 0xf8) != (char *)0x0) {
pcVar2 = *(char **)(this + 0xf8);
}
this_00 = (CBaseEntity *)
CGlobalEntityList::FindEntityByName
((CGlobalEntityList *)gEntList,(CBaseEntity *)0x0,pcVar2,(CBaseEntity *)0x0,
(CBaseEntity *)0x0,(CBaseEntity *)0x0,(IEntityFindFilter *)0x0);
*(CBaseEntity **)(this + 0x440) = this_00;
if (this_00 != (CBaseEntity *)0x0) {
if (*(char **)(this_00 + 0x7c) != "path_track") {
cVar1 = CBaseEntity::ClassMatchesComplex(this_00,"path_track");
this_00 = *(CBaseEntity **)(this + 0x440);
if ((cVar1 == '\0') && (*(char **)(this_00 + 0x7c) != "env_portal_path_track")) {
cVar1 = CBaseEntity::ClassMatchesComplex(this_00,"env_portal_path_track");
if (cVar1 == '\0') {
Warning("func_track_train must be on a path of path_track\n");
*(undefined4 *)(this + 0x440) = 0;
return;
}
this_00 = *(CBaseEntity **)(this + 0x440);
}
}
local_34 = *(float *)(this_00 + 0x3a4);
local_3c = *(float *)(this_00 + 0x39c);
local_38 = *(float *)(this_00 + 0x3a0);
local_30 = local_3c;
local_2c = local_38;
local_28 = local_34;
CPathTrack::LookAhead
((CPathTrack *)this_00,(Vector *)&local_30,*(float *)(this + 0x444),0,
(CPathTrack **)0x0);
local_34 = local_34 + *(float *)(this + 0x480);
local_28 = *(float *)(this + 0x480) + local_28;
if (((byte)this[0x148] & 0x10) == 0) {
local_10 = local_28 - local_34;
local_18 = local_30 - local_3c;
local_14 = local_2c - local_38;
VectorAngles((Vector *)&local_18,(QAngle *)&local_24);
if (((byte)this[0x148] & 1) != 0) {
local_24 = 0;
}
}
else {
local_24 = *(undefined4 *)(this + 0x3a8);
local_20 = *(undefined4 *)(this + 0x3ac);
local_1c = *(undefined4 *)(this + 0x3b0);
}
(**(code **)(*(int *)this + 0x1dc))(this,&local_3c,&local_24,0);
ArriveAtNode(this,*(CPathTrack **)(this + 0x440));
if (*(float *)(this + 0x11c) != 0.0) {
CBaseEntity::SetNextThink((CBaseEntity *)this,*(float *)(gpGlobals + 0xc) + 0.1,(char *)0x0);
CBaseEntity::ThinkSet((_func_void *)local_44,(float)this,(char *)Next);
SoundUpdate(this);
return;
}
}
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.