InfoChangelevel::ChangelevelThink
0x00866350 · 839 bytes · __thiscall
_ZN15InfoChangelevel16ChangelevelThinkEv
Decompiled
undefined (1 param)
/* InfoChangelevel::ChangelevelThink() */
void __thiscall InfoChangelevel::ChangelevelThink(InfoChangelevel *this)
{
int *piVar1;
char cVar2;
CBaseCombatCharacter *pCVar3;
uint uVar4;
int iVar5;
CBaseEntity *this_00;
int iVar6;
CTerrorPlayer *local_50;
undefined4 local_4c;
undefined4 local_48;
undefined4 local_44;
int local_40;
undefined4 local_3c;
undefined4 local_38;
undefined4 local_34;
undefined4 local_30;
int local_2c;
undefined4 local_28;
undefined1 local_24;
undefined1 local_23;
undefined1 local_22;
InfoChangelevel *local_20;
iVar6 = 1;
CBaseEntity::SetNextThink((CBaseEntity *)this,*(float *)(gpGlobals + 0xc) + 1.0,(char *)0x0);
local_38 = 0;
local_34 = 0;
local_30 = 0;
local_2c = 0;
local_20 = this;
local_28 = 0;
local_24 = 0;
local_23 = 0;
local_22 = 0;
local_4c = 0;
local_48 = 0;
local_44 = 0;
local_40 = 0;
local_3c = 0;
if (0 < *(int *)(gpGlobals + 0x14)) {
do {
while ((pCVar3 = (CBaseCombatCharacter *)UTIL_PlayerByIndex(iVar6),
pCVar3 == (CBaseCombatCharacter *)0x0 || (*(int *)(pCVar3 + 0x30) == 0))) {
LAB_00866428:
iVar6 = iVar6 + 1;
if (*(int *)(gpGlobals + 0x14) < iVar6) goto LAB_00866467;
}
if (*(int *)(pCVar3 + 0x30) - *(int *)(gpGlobals + 0x58) >> 4 != 0) {
/* try { // try from 008663f8 to 008666a1 has its CatchHandler @ 008666ac */
cVar2 = (**(code **)(*(int *)pCVar3 + 0x16c))(pCVar3);
if ((((cVar2 == '\0') || (*(int *)(pCVar3 + 0x1f6c) == 2)) ||
(iVar5 = (**(code **)(*(int *)pCVar3 + 0x148))(pCVar3), iVar5 != 0)) ||
(cVar2 = InfoChangelevelPlayerCollector::operator()
((InfoChangelevelPlayerCollector *)&local_4c,pCVar3), cVar2 != '\0'))
goto LAB_00866428;
goto LAB_00866590;
}
iVar6 = iVar6 + 1;
} while (iVar6 <= *(int *)(gpGlobals + 0x14));
}
LAB_00866467:
iVar6 = TheNextBots();
uVar4 = (uint)*(ushort *)(iVar6 + 0x10);
if (uVar4 != 0xffff) {
iVar5 = *(int *)(iVar6 + 4);
do {
piVar1 = *(int **)(iVar5 + uVar4 * 8);
this_00 = (CBaseEntity *)(**(code **)(*piVar1 + 0xb4))(piVar1);
cVar2 = (**(code **)(*(int *)this_00 + 300))(this_00);
if (cVar2 != '\0') {
cVar2 = (**(code **)(*(int *)this_00 + 0x16c))(this_00);
if (cVar2 == '\0') {
local_50 = (CTerrorPlayer *)0x0;
}
else {
local_50 = (CTerrorPlayer *)this_00;
cVar2 = (**(code **)(*(int *)this_00 + 0x558))(this_00);
if (cVar2 != '\0') goto LAB_008664d0;
}
iVar5 = CBaseEntity::GetTeamNumber(this_00);
if (iVar5 == 2) {
if (local_50 != (CTerrorPlayer *)0x0) {
cVar2 = CBaseTrigger::IsTouching((CBaseTrigger *)local_20,this_00);
if (((cVar2 == '\0') || (this_00[0x186] == (CBaseEntity)0x8)) ||
((iVar5 = (**(code **)(*(int *)this_00 + 0x52c))(this_00), iVar5 == 0 ||
(iVar5 = (**(code **)(*(int *)this_00 + 0x52c))(this_00),
(*(byte *)(iVar5 + 0x12d) & 8) == 0)))) {
CUtlVector<CTerrorPlayer*,CUtlMemory<CTerrorPlayer*,int>>::InsertBefore
((CUtlVector<CTerrorPlayer*,CUtlMemory<CTerrorPlayer*,int>> *)&local_38,
local_2c,&local_50);
local_23 = 1;
}
else {
CUtlVector<CTerrorPlayer*,CUtlMemory<CTerrorPlayer*,int>>::InsertBefore
((CUtlVector<CTerrorPlayer*,CUtlMemory<CTerrorPlayer*,int>> *)&local_4c,
local_40,&local_50);
cVar2 = CDirector::IsAllBotSurvivorTeam();
if ((cVar2 != '\0') ||
(cVar2 = (**(code **)(*(int *)local_50 + 0x778))(local_50), cVar2 == '\0')) {
local_22 = 1;
}
}
}
}
else if ((((iVar5 == 3) &&
(cVar2 = CBaseTrigger::IsTouching((CBaseTrigger *)local_20,this_00), cVar2 != '\0'
)) && (iVar5 = (**(code **)(*(int *)this_00 + 0x52c))(this_00), iVar5 != 0)) &&
(iVar5 = (**(code **)(*(int *)this_00 + 0x52c))(this_00),
(*(byte *)(iVar5 + 0x12d) & 8) != 0)) {
local_24 = 1;
}
}
LAB_008664d0:
iVar5 = *(int *)(iVar6 + 4);
uVar4 = (uint)*(ushort *)(iVar5 + 6 + uVar4 * 8);
} while (uVar4 != 0xffff);
}
LAB_00866590:
UpdateChangelevel(this,(InfoChangelevelPlayerCollector *)&local_4c);
local_2c = 0;
CUtlMemory<CTerrorPlayer*,int>::Purge((CUtlMemory<CTerrorPlayer*,int> *)&local_38);
local_28 = local_38;
CUtlMemory<CTerrorPlayer*,int>::Purge((CUtlMemory<CTerrorPlayer*,int> *)&local_38);
local_40 = 0;
CUtlMemory<CTerrorPlayer*,int>::Purge((CUtlMemory<CTerrorPlayer*,int> *)&local_4c);
local_3c = local_4c;
CUtlMemory<CTerrorPlayer*,int>::Purge((CUtlMemory<CTerrorPlayer*,int> *)&local_4c);
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.