CHLTVDirector::StartBestFixedCameraShot
0x006db510 · 522 bytes · __thiscall
_ZN13CHLTVDirector24StartBestFixedCameraShotEb
Decompiled
undefined (2 params)
/* CHLTVDirector::StartBestFixedCameraShot(bool) */
void __thiscall CHLTVDirector::StartBestFixedCameraShot(CHLTVDirector *this,bool param_1)
{
ushort uVar1;
uint uVar2;
char *pcVar3;
int iVar4;
int iVar5;
float *pfVar6;
longdouble lVar7;
float fVar8;
undefined4 local_134;
int local_130;
float local_12c;
float local_11c [67];
if (0 < *(int *)(this + 0x44)) {
pfVar6 = local_11c;
for (iVar5 = 0x40; iVar5 != 0; iVar5 = iVar5 + -1) {
*pfVar6 = 0.0;
pfVar6 = pfVar6 + 1;
}
uVar2 = FindFirstEvent(this,*(int *)(this + 0x1c));
if (uVar2 != 0xffff) {
uVar2 = uVar2 & 0xffff;
iVar5 = *(int *)(this + 0x1d4) + uVar2 * 0x14;
if (*(int *)(iVar5 + 8) < *(int *)(this + 0x38)) {
local_134 = 0xffffffff;
local_130 = -1;
local_12c = -1.0;
do {
pcVar3 = (char *)(**(code **)(**(int **)(iVar5 + 0x10) + 8))(*(int **)(iVar5 + 0x10));
iVar4 = _V_strcmp(pcVar3,"hltv_rank_camera");
if (iVar4 == 0) {
iVar4 = (**(code **)(**(int **)(iVar5 + 0x10) + 0x1c))
(*(int **)(iVar5 + 0x10),"index",0);
lVar7 = (longdouble)
(**(code **)(**(int **)(iVar5 + 0x10) + 0x24))
(*(int **)(iVar5 + 0x10),&DAT_00c9394f,0);
fVar8 = (float)lVar7 + local_11c[iVar4];
local_11c[iVar4] = fVar8;
if (local_12c < fVar8) {
local_134 = (**(code **)(**(int **)(iVar5 + 0x10) + 0x1c))
(*(int **)(iVar5 + 0x10),"target",0);
local_130 = iVar4;
local_12c = fVar8;
}
}
uVar1 = CUtlRBTree<CGameEvent,unsigned_short,bool(*)(CGameEvent_const&,CGameEvent_const&),CUtlMemory<UtlRBTreeNode_t<CGameEvent,unsigned_short>,unsigned_short>>
::NextInorder((CUtlRBTree<CGameEvent,unsigned_short,bool(*)(CGameEvent_const&,CGameEvent_const&),CUtlMemory<UtlRBTreeNode_t<CGameEvent,unsigned_short>,unsigned_short>>
*)(this + 0x1d0),(ushort)uVar2);
if (uVar1 == 0xffff) break;
uVar2 = (uint)uVar1;
iVar5 = *(int *)(this + 0x1d4) + uVar2 * 0x14;
} while (*(int *)(iVar5 + 8) < *(int *)(this + 0x38));
if ((local_12c == 0.0) && (!param_1)) {
/* WARNING: Could not recover jumptable at 0x006db723. Too many branches */
/* WARNING: Treating indirect jump as call */
(**(code **)(*(int *)this + 0x58))();
return;
}
if (local_130 != -1) {
(**(code **)(*(int *)this + 0x5c))(this,local_130,local_134);
}
}
}
}
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.