CFinaleTrigger::Use
0x004e91c0 · 689 bytes · __cdecl
_ZN14CFinaleTrigger3UseEP11CBaseEntityS1_8USE_TYPEf
Decompiled
undefined (4 params)
/* CFinaleTrigger::Use(CBaseEntity*, CBaseEntity*, USE_TYPE, float) */
void CFinaleTrigger::Use(CBaseEntity *param_1,CBaseEntity *param_2)
{
CBaseEdict *this;
char cVar1;
bool bVar2;
int iVar3;
undefined4 *puVar4;
int *piVar5;
undefined4 uVar6;
code *pcVar7;
undefined1 local_34 [22];
SurvivorsInFinaleScan local_1e;
undefined1 local_1d;
if (param_1[0x161c] != (CBaseEntity)0x0) {
return;
}
if (param_2 == (CBaseEntity *)0x0) {
return;
}
cVar1 = (**(code **)(*(int *)param_2 + 0x16c))(param_2);
if (cVar1 == '\0') {
return;
}
iVar3 = CBaseEntity::GetTeamNumber(param_2);
if (iVar3 == 2) {
if (**(int **)(TheDirector + 0x638) != 5) {
return;
}
if (**(char **)(TheDirector + 0x640) != '\0') {
return;
}
cVar1 = CTerrorGameRules::IsSurvivalMode();
if (cVar1 == '\0') {
local_1e = (SurvivorsInFinaleScan)0x1;
local_1d = 0;
bVar2 = ForEachSurvivor<SurvivorsInFinaleScan>(&local_1e);
if (!bVar2) {
piVar5 = (int *)(**(code **)(*gameeventmanager + 0x1c))
(gameeventmanager,"waiting_checkpoint_button_used",0,0);
if (piVar5 == (int *)0x0) {
return;
}
pcVar7 = *(code **)(*piVar5 + 0x30);
uVar6 = (**(code **)(*engine + 0x40))(engine,*(undefined4 *)(param_2 + 0x30));
(*pcVar7)(piVar5,"userid",uVar6);
(**(code **)(*gameeventmanager + 0x20))(gameeventmanager,piVar5,0);
return;
}
if (*(int *)(param_1 + 0x1620) == 0) {
CServerNetworkProperty::NetworkStateChanged((short)param_1 + 0x24);
*(undefined4 *)(param_1 + 0x1620) = 1;
CBaseEntity::ThinkSet((_func_void *)local_34,(float)param_1,(char *)FirstUseDelayThink);
CBaseEntity::SetNextThink
(param_1,*(float *)(param_1 + 0x1614) + *(float *)(gpGlobals + 0xc),(char *)0x0);
COutputEvent::FireOutput((COutputEvent *)(param_1 + 0x1594),param_1,param_1,0.0);
return;
}
if (*(int *)(param_1 + 0x1620) != 2) {
return;
}
CServerNetworkProperty::NetworkStateChanged((short)param_1 + 0x24);
*(undefined4 *)(param_1 + 0x1620) = 4;
puVar4 = (undefined4 *)(**(code **)(*(int *)param_2 + 0xc))(param_2);
*(undefined4 *)(param_1 + 0x1630) = *puVar4;
pcVar7 = DelayedFinaleStartThink;
}
else {
if (*(int *)(param_1 + 0x1620) != 4) {
if (param_1[0x6c] == (CBaseEntity)0x0) {
this = *(CBaseEdict **)(param_1 + 0x30);
if (this != (CBaseEdict *)0x0) {
*(uint *)this = *(uint *)this | 0x101;
iVar3 = CBaseEdict::GetChangeAccessor(this);
*(undefined2 *)(iVar3 + 2) = 0;
}
}
else {
param_1[0x70] = (CBaseEntity)((byte)param_1[0x70] | 1);
}
*(undefined4 *)(param_1 + 0x1620) = 4;
}
puVar4 = (undefined4 *)(**(code **)(*(int *)param_2 + 0xc))(param_2);
*(undefined4 *)(param_1 + 0x1630) = *puVar4;
pcVar7 = DelayedSurvivalStartThink;
}
CBaseEntity::ThinkSet((_func_void *)local_34,(float)param_1,(char *)pcVar7);
CBaseEntity::SetNextThink
(param_1,*(float *)(param_1 + 0x1618) + *(float *)(gpGlobals + 0xc),(char *)0x0);
COutputEvent::FireOutput((COutputEvent *)(param_1 + 0x15ac),param_2,param_1,0.0);
return;
}
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.