CFuncTrain::Activate
0x00b0c170 · 693 bytes · __thiscall
_ZN10CFuncTrain8ActivateEv
Decompiled
undefined (1 param)
/* WARNING: Removing unreachable block (ram,0x00b0c209) */
/* WARNING: Removing unreachable block (ram,0x00b0c43d) */
/* CFuncTrain::Activate() */
void __thiscall CFuncTrain::Activate(CFuncTrain *this)
{
CBaseEdict *this_00;
int iVar1;
undefined *puVar2;
int iVar3;
uint uVar4;
float local_28;
float local_24;
float local_20;
CBaseEntity::Activate((CBaseEntity *)this);
if (this[0x4d4] == (CFuncTrain)0x0) {
SetupTarget(this);
uVar4 = *(uint *)(this + 0x4d0);
this[0x4d4] = (CFuncTrain)0x1;
if ((((uVar4 != 0xffffffff) &&
(puVar2 = g_pEntityList + (uVar4 & 0xfff) * 0x10, puVar2 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar2 + 8) == uVar4 >> 0xc)) && (*(int *)(puVar2 + 4) != 0)) {
if ((AllocTempVector()::s_vecTemp == '\0') &&
(iVar1 = __cxa_guard_acquire(&AllocTempVector()::s_vecTemp), iVar1 != 0)) {
__cxa_guard_release(&AllocTempVector()::s_vecTemp);
}
if ((AllocTempVector()::s_nIndex == '\0') &&
(iVar1 = __cxa_guard_acquire(&AllocTempVector()::s_nIndex), iVar1 != 0)) {
AllocTempVector()::s_nIndex = 0;
__cxa_guard_release(&AllocTempVector()::s_nIndex);
}
puVar2 = g_pEntityList;
AllocTempVector()::s_nIndex = AllocTempVector()::s_nIndex + 0x10001 & 0x7f;
LOCK();
UNLOCK();
iVar1 = 0;
iVar3 = AllocTempVector()::s_nIndex * 0xc;
local_28 = (*(float *)(this + 0x1a8) - *(float *)(this + 0x19c)) * 0.5 +
*(float *)(this + 0x19c);
*(float *)(AllocTempVector()::s_vecTemp + iVar3) = local_28;
local_24 = (*(float *)(this + 0x1ac) - *(float *)(this + 0x1a0)) * 0.5 +
*(float *)(this + 0x1a0);
*(float *)(AllocTempVector()::s_vecTemp + iVar3 + 4) = local_24;
local_20 = (*(float *)(this + 0x1b0) - *(float *)(this + 0x1a4)) * 0.5 +
*(float *)(this + 0x1a4);
*(float *)(AllocTempVector()::s_vecTemp + iVar3 + 8) = local_20;
uVar4 = *(uint *)(this + 0x4d0);
if (((uVar4 != 0xffffffff) &&
(puVar2 = puVar2 + (uVar4 & 0xfff) * 0x10, puVar2 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar2 + 8) == uVar4 >> 0xc)) {
iVar1 = *(int *)(puVar2 + 4);
}
local_28 = *(float *)(iVar1 + 0x39c) - local_28;
local_24 = *(float *)(iVar1 + 0x3a0) - local_24;
local_20 = *(float *)(iVar1 + 0x3a4) - local_20;
UTIL_SetOrigin((CBaseEntity *)this,(Vector *)&local_28,false);
iVar1 = (**(code **)(*(int *)(this + 0x194) + 0x2c))(this + 0x194);
if (iVar1 == 1) {
CBaseEntity::VPhysicsInitShadow((CBaseEntity *)this,false,false,(solid_t *)0x0);
}
if (*(int *)(this + 0x154) == 0) {
CBaseEntity::SetMoveDoneTime((CBaseEntity *)this,0.1);
*(code **)(this + 0x14) = Next;
*(undefined4 *)(this + 0x18) = 0;
}
else {
uVar4 = *(uint *)(this + 0x148) | 1;
if (*(uint *)(this + 0x148) != uVar4) {
if (this[0x6c] == (CFuncTrain)0x0) {
this_00 = *(CBaseEdict **)(this + 0x30);
if (this_00 != (CBaseEdict *)0x0) {
*(uint *)this_00 = *(uint *)this_00 | 0x101;
iVar1 = CBaseEdict::GetChangeAccessor(this_00);
*(undefined2 *)(iVar1 + 2) = 0;
}
}
else {
this[0x70] = (CFuncTrain)((byte)this[0x70] | 1);
}
*(uint *)(this + 0x148) = uVar4;
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.