InfoChangelevel::OnCheckpointDoorClosed
0x008666d0 · 1228 bytes · __cdecl
_ZN15InfoChangelevel22OnCheckpointDoorClosedER11inputdata_t
Decompiled
undefined (1 param)
/* InfoChangelevel::OnCheckpointDoorClosed(inputdata_t&) */
void InfoChangelevel::OnCheckpointDoorClosed(inputdata_t *param_1)
{
int *piVar1;
code *pcVar2;
char cVar3;
CBaseCombatCharacter *pCVar4;
uint uVar5;
int iVar6;
CBaseEntity *this;
undefined4 uVar7;
int iVar8;
int in_GS_OFFSET;
CTerrorPlayer *local_164 [2];
int local_15c [5];
int local_148 [5];
undefined1 local_134;
char local_133;
char local_132;
inputdata_t *local_130;
CFmtStrN<256> local_12c [5];
undefined1 local_127 [263];
int local_20;
iVar8 = 1;
local_134 = 0;
local_148[0] = 0;
local_148[1] = 0;
local_148[2] = 0;
local_148[3] = 0;
local_130 = param_1;
local_148[4] = 0;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
local_133 = '\0';
local_132 = '\0';
local_15c[0] = 0;
local_15c[1] = 0;
local_15c[2] = 0;
local_15c[3] = 0;
local_15c[4] = 0;
if (0 < *(int *)(gpGlobals + 0x14)) {
do {
while ((pCVar4 = (CBaseCombatCharacter *)UTIL_PlayerByIndex(iVar8),
pCVar4 == (CBaseCombatCharacter *)0x0 || (*(int *)(pCVar4 + 0x30) == 0))) {
LAB_008667c0:
iVar8 = iVar8 + 1;
if (*(int *)(gpGlobals + 0x14) < iVar8) goto LAB_00866802;
}
if (*(int *)(pCVar4 + 0x30) - *(int *)(gpGlobals + 0x58) >> 4 != 0) {
/* try { // try from 00866793 to 00866ba7 has its CatchHandler @ 00866bba */
cVar3 = (**(code **)(*(int *)pCVar4 + 0x16c))(pCVar4);
if ((((cVar3 == '\0') || (*(int *)(pCVar4 + 0x1f6c) == 2)) ||
(iVar6 = (**(code **)(*(int *)pCVar4 + 0x148))(pCVar4), iVar6 != 0)) ||
(cVar3 = InfoChangelevelPlayerCollector::operator()
((InfoChangelevelPlayerCollector *)local_15c,pCVar4), cVar3 != '\0'))
goto LAB_008667c0;
goto LAB_00866958;
}
iVar8 = iVar8 + 1;
} while (iVar8 <= *(int *)(gpGlobals + 0x14));
}
LAB_00866802:
iVar8 = TheNextBots();
uVar5 = (uint)*(ushort *)(iVar8 + 0x10);
if (uVar5 != 0xffff) {
iVar6 = *(int *)(iVar8 + 4);
do {
piVar1 = *(int **)(iVar6 + uVar5 * 8);
this = (CBaseEntity *)(**(code **)(*piVar1 + 0xb4))(piVar1);
cVar3 = (**(code **)(*(int *)this + 300))(this);
if (cVar3 != '\0') {
cVar3 = (**(code **)(*(int *)this + 0x16c))(this);
if (cVar3 == '\0') {
local_164[0] = (CTerrorPlayer *)0x0;
}
else {
local_164[0] = (CTerrorPlayer *)this;
cVar3 = (**(code **)(*(int *)this + 0x558))(this);
if (cVar3 != '\0') goto LAB_00866880;
}
iVar6 = CBaseEntity::GetTeamNumber(this);
if (iVar6 == 2) {
if (local_164[0] != (CTerrorPlayer *)0x0) {
cVar3 = CBaseTrigger::IsTouching((CBaseTrigger *)local_130,this);
if (((cVar3 == '\0') || (this[0x186] == (CBaseEntity)0x8)) ||
((iVar6 = (**(code **)(*(int *)this + 0x52c))(this), iVar6 == 0 ||
(iVar6 = (**(code **)(*(int *)this + 0x52c))(this),
(*(byte *)(iVar6 + 0x12d) & 8) == 0)))) {
CUtlVector<CTerrorPlayer*,CUtlMemory<CTerrorPlayer*,int>>::InsertBefore
((CUtlVector<CTerrorPlayer*,CUtlMemory<CTerrorPlayer*,int>> *)local_148,
local_148[3],local_164);
local_133 = '\x01';
}
else {
CUtlVector<CTerrorPlayer*,CUtlMemory<CTerrorPlayer*,int>>::InsertBefore
((CUtlVector<CTerrorPlayer*,CUtlMemory<CTerrorPlayer*,int>> *)local_15c,
local_15c[3],local_164);
cVar3 = CDirector::IsAllBotSurvivorTeam();
if ((cVar3 != '\0') ||
(cVar3 = (**(code **)(*(int *)local_164[0] + 0x778))(local_164[0]), cVar3 == '\0'))
{
local_132 = '\x01';
}
}
}
}
else if ((((iVar6 == 3) &&
(cVar3 = CBaseTrigger::IsTouching((CBaseTrigger *)local_130,this), cVar3 != '\0'))
&& (iVar6 = (**(code **)(*(int *)this + 0x52c))(this), iVar6 != 0)) &&
(iVar6 = (**(code **)(*(int *)this + 0x52c))(this),
(*(byte *)(iVar6 + 0x12d) & 8) != 0)) {
local_134 = 1;
}
}
LAB_00866880:
iVar6 = *(int *)(iVar8 + 4);
uVar5 = (uint)*(ushort *)(iVar6 + 6 + uVar5 * 8);
} while (uVar5 != 0xffff);
}
LAB_00866958:
UpdateChangelevel((InfoChangelevel *)param_1,(InfoChangelevelPlayerCollector *)local_15c);
if (((param_1[0x5a9] == (inputdata_t)0x0) && (local_132 != '\0')) && (local_133 != '\0')) {
iVar8 = RandomInt(0,local_15c[3] + -1);
iVar6 = RandomInt(0,local_148[3] + -1);
piVar1 = *(int **)(local_15c[0] + iVar8 * 4);
uVar7 = SurvivorCharacterName(*(undefined4 *)(*(int *)(local_148[0] + iVar6 * 4) + 0x2ba0));
CFmtStrN<256>::CFmtStrN(local_12c,"Subject:%s",uVar7);
pcVar2 = *(code **)(*piVar1 + 0x7b4);
CAI_Concept::CAI_Concept((CAI_Concept *)local_164,"PlayerOutsideCheckpoint");
(*pcVar2)(piVar1,(CAI_Concept *)local_164,3,local_127,0,0,0);
}
local_148[3] = 0;
CUtlMemory<CTerrorPlayer*,int>::Purge((CUtlMemory<CTerrorPlayer*,int> *)local_148);
local_148[4] = local_148[0];
CUtlMemory<CTerrorPlayer*,int>::Purge((CUtlMemory<CTerrorPlayer*,int> *)local_148);
local_15c[3] = 0;
CUtlMemory<CTerrorPlayer*,int>::Purge((CUtlMemory<CTerrorPlayer*,int> *)local_15c);
local_15c[4] = local_15c[0];
CUtlMemory<CTerrorPlayer*,int>::Purge((CUtlMemory<CTerrorPlayer*,int> *)local_15c);
if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
/* WARNING: Subroutine does not return */
__stack_chk_fail();
}
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.