CSceneManager::Think
0x00815f80 · 436 bytes · __thiscall
_ZN13CSceneManager5ThinkEv
Decompiled
undefined (1 param)
/* CSceneManager::Think() */
void __thiscall CSceneManager::Think(CSceneManager *this)
{
uint uVar1;
int *piVar2;
bool bVar3;
undefined *puVar4;
int iVar5;
int iVar6;
int iVar7;
longdouble lVar8;
float fVar9;
g_bClientFlex = *(int *)(scene_clientflex._28_4_ + 0x30) != 0;
iVar5 = 0;
CBaseEntity::SetNextThink((CBaseEntity *)this,*(float *)(gpGlobals + 0xc) + 0.001,(char *)0x0);
fVar9 = *(float *)(gpGlobals + 0xc);
lVar8 = (longdouble)CBaseEntity::GetLastThink((CBaseEntity *)this,(char *)0x0);
bVar3 = false;
fVar9 = fVar9 - (float)lVar8;
if (0.1 <= fVar9) {
fVar9 = 0.1;
}
iVar6 = *(int *)(this + 0x44c);
if (0 < *(int *)(this + 0x44c)) {
LAB_0081603b:
do {
uVar1 = *(uint *)(*(int *)(this + 0x440) + iVar5 * 4);
if ((((uVar1 == 0xffffffff) ||
(puVar4 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar4 == (undefined *)0xfffffffc)) ||
(*(uint *)(puVar4 + 8) != uVar1 >> 0xc)) ||
(piVar2 = *(int **)(puVar4 + 4), piVar2 == (int *)0x0)) {
bVar3 = true;
}
else {
(**(code **)(*piVar2 + 0x33c))(piVar2,fVar9);
iVar7 = *(int *)(this + 0x44c);
if (iVar7 < iVar6) {
iVar6 = iVar7;
if (iVar7 <= iVar5) break;
goto LAB_0081603b;
}
}
iVar5 = iVar5 + 1;
} while (iVar5 < iVar6);
if ((bVar3) && (iVar6 = iVar6 + -1, -1 < iVar6)) {
iVar5 = iVar6 * 4;
do {
while (((uVar1 = *(uint *)(*(int *)(this + 0x440) + iVar5), uVar1 == 0xffffffff ||
(puVar4 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar4 == (undefined *)0xfffffffc)
) || ((*(uint *)(puVar4 + 8) != uVar1 >> 0xc || (*(int *)(puVar4 + 4) == 0))))) {
iVar7 = iVar6 + -1;
iVar5 = iVar5 + -4;
CUtlVector<CHandle<CSceneEntity>,CUtlMemory<CHandle<CSceneEntity>,int>>::ShiftElementsLeft
((CUtlVector<CHandle<CSceneEntity>,CUtlMemory<CHandle<CSceneEntity>,int>> *)
(this + 0x440),iVar6,1);
*(int *)(this + 0x44c) = *(int *)(this + 0x44c) + -1;
iVar6 = iVar7;
if (iVar7 == -1) {
return;
}
}
iVar6 = iVar6 + -1;
iVar5 = iVar5 + -4;
} while (iVar6 != -1);
}
}
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.