CFinaleTrigger::OnFinaleEscapeForceSurvivorPositions
0x004eb5b0 · 824 bytes · __thiscall
_ZN14CFinaleTrigger36OnFinaleEscapeForceSurvivorPositionsER11inputdata_t
Decompiled
undefined (2 params)
/* CFinaleTrigger::OnFinaleEscapeForceSurvivorPositions(inputdata_t&) */
void __thiscall
CFinaleTrigger::OnFinaleEscapeForceSurvivorPositions(CFinaleTrigger *this,inputdata_t *param_1)
{
uint uVar1;
CBaseEntity *this_00;
char cVar2;
int iVar3;
int iVar4;
undefined *puVar5;
undefined *puVar6;
int iVar7;
CDirector *this_01;
CUtlMemory<CTerrorPlayer*,int> *local_50;
int local_44;
undefined4 local_40;
undefined4 local_3c;
int local_38;
int local_34;
CTerrorPlayer *local_30;
undefined4 local_2c;
undefined4 local_28;
int local_24;
CBaseEntity *local_20;
this_01 = TheDirector;
if ((**(int **)(TheDirector + 0x638) == 5) && (**(char **)(TheDirector + 0x648) == '\0')) {
return;
}
local_44 = 0;
local_40 = 0;
local_3c = 0;
local_38 = 0;
iVar7 = *(int *)(param_1 + 4);
local_34 = 0;
if (iVar7 != 0) {
iVar3 = __dynamic_cast(iVar7,&CBaseEntity::typeinfo,&CBaseTrigger::typeinfo,0);
if (iVar3 != 0) {
LAB_004eb629:
if (0 < *(int *)(iVar3 + 0x560)) {
iVar7 = 0;
do {
/* try { // try from 004eb693 to 004eb731 has its CatchHandler @ 004eb942 */
while ((((uVar1 = *(uint *)(*(int *)(iVar3 + 0x554) + iVar7 * 4), uVar1 != 0xffffffff &&
(puVar5 = g_pEntityList + (uVar1 & 0xfff) * 0x10,
puVar5 != (undefined *)0xfffffffc)) &&
((*(uint *)(puVar5 + 8) == uVar1 >> 0xc &&
(((this_00 = *(CBaseEntity **)(puVar5 + 4), this_00 != (CBaseEntity *)0x0 &&
(cVar2 = (**(code **)(*(int *)this_00 + 0x16c))(this_00), cVar2 != '\0')) &&
(local_30 = (CTerrorPlayer *)this_00,
iVar4 = CBaseEntity::GetTeamNumber(this_00), iVar4 == 2)))))) &&
(cVar2 = (**(code **)(*(int *)local_30 + 300))(local_30), cVar2 != '\0'))) {
CUtlVector<CTerrorPlayer*,CUtlMemory<CTerrorPlayer*,int>>::InsertBefore
((CUtlVector<CTerrorPlayer*,CUtlMemory<CTerrorPlayer*,int>> *)&local_44,
local_38,&local_30);
iVar7 = iVar7 + 1;
this_01 = TheDirector;
if (*(int *)(iVar3 + 0x560) <= iVar7) goto LAB_004eb6f6;
}
iVar7 = iVar7 + 1;
this_01 = TheDirector;
} while (iVar7 < *(int *)(iVar3 + 0x560));
}
goto LAB_004eb6f6;
}
iVar7 = __dynamic_cast(iVar7,&CBaseEntity::typeinfo,&CLogicRelay::typeinfo,0);
puVar5 = g_pEntityList;
while ((((iVar7 != 0 && (uVar1 = *(uint *)(iVar7 + 0x470), uVar1 != 0xffffffff)) &&
(puVar6 = puVar5 + (uVar1 & 0xfff) * 0x10, puVar6 != (undefined *)0xfffffffc)) &&
((*(uint *)(puVar6 + 8) == uVar1 >> 0xc && (iVar7 = *(int *)(puVar6 + 4), iVar7 != 0)))))
{
iVar3 = __dynamic_cast(iVar7,&CBaseEntity::typeinfo,&CBaseTrigger::typeinfo,0);
if (iVar3 != 0) goto LAB_004eb629;
iVar7 = __dynamic_cast(iVar7,&CBaseEntity::typeinfo,&CLogicRelay::typeinfo,0);
}
}
local_30 = (CTerrorPlayer *)0x0;
local_2c = 0;
local_28 = 0;
local_24 = 0;
local_20 = (CBaseEntity *)0x0;
/* try { // try from 004eb7fe to 004eb8c6 has its CatchHandler @ 004eb8fb */
ForEachSurvivor<AmbulatorySurvivorCollector>((AmbulatorySurvivorCollector *)&local_30);
iVar7 = local_24;
local_38 = 0;
if (local_24 != 0) {
CUtlVector<CTerrorPlayer*,CUtlMemory<CTerrorPlayer*,int>>::GrowVector
((CUtlVector<CTerrorPlayer*,CUtlMemory<CTerrorPlayer*,int>> *)&local_44,local_24);
CUtlVector<CTerrorPlayer*,CUtlMemory<CTerrorPlayer*,int>>::ShiftElementsRight
((CUtlVector<CTerrorPlayer*,CUtlMemory<CTerrorPlayer*,int>> *)&local_44,0,iVar7);
if (0 < iVar7) {
iVar3 = 0;
do {
*(undefined4 *)(local_44 + iVar3 * 4) = *(undefined4 *)(local_30 + iVar3 * 4);
iVar3 = iVar3 + 1;
} while (iVar3 != iVar7);
}
}
local_24 = 0;
CUtlMemory<CTerrorPlayer*,int>::Purge((CUtlMemory<CTerrorPlayer*,int> *)&local_30);
local_20 = (CBaseEntity *)local_30;
CUtlMemory<CTerrorPlayer*,int>::Purge((CUtlMemory<CTerrorPlayer*,int> *)&local_30);
this_01 = TheDirector;
LAB_004eb6f6:
local_50 = (CUtlMemory<CTerrorPlayer*,int> *)&local_44;
CDirector::OnFinaleEscapeForceSurvivorPositions(this_01,(CUtlVector *)local_50);
CTerrorGameRules::StoreSacrificeEscapees(g_pGameRules);
COutputEvent::FireOutput
((COutputEvent *)(this + 0x15f4),(CBaseEntity *)this,(CBaseEntity *)this,0.0);
local_38 = 0;
CUtlMemory<CTerrorPlayer*,int>::Purge(local_50);
local_34 = local_44;
CUtlMemory<CTerrorPlayer*,int>::Purge(local_50);
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.