CFinaleTrigger::Spawn
0x004e8400 · 746 bytes · __thiscall
_ZN14CFinaleTrigger5SpawnEv
Decompiled
undefined (1 param)
/* CFinaleTrigger::Spawn() */
void __thiscall CFinaleTrigger::Spawn(CFinaleTrigger *this)
{
CBaseEdict *pCVar1;
char cVar2;
int iVar3;
char *pcVar4;
double dVar5;
double dVar6;
char *local_10;
this[0x160c] = (CFinaleTrigger)0x0;
*(undefined4 *)(this + 0x1630) = 0xffffffff;
CBreakableProp::Spawn((CBreakableProp *)this);
CBaseEntity::SetMoveType((CBaseEntity *)this,0,0);
(**(code **)(*(int *)this + 0x20))(&local_10);
pcVar4 = "";
if (local_10 != (char *)0x0) {
pcVar4 = local_10;
}
if (*pcVar4 != '\0') {
CBaseEntity::PrecacheModel(pcVar4);
(**(code **)(*(int *)this + 0x6c))(this);
(**(code **)(*(int *)this + 0x70))(this,pcVar4);
CCollisionProperty::SetSolid((CCollisionProperty *)(this + 0x194),6);
CCollisionProperty::UseTriggerBounds((CCollisionProperty *)(this + 0x194),true,16.0);
if (this[0x105] != (CFinaleTrigger)0x0) {
(**(code **)(*(int *)this + 0x224))(this,this + 0x105);
this[0x105] = (CFinaleTrigger)0x0;
}
if (*(int *)(this + 0xfc) != 0) {
(**(code **)(*(int *)this + 0x20c))(this,this + 0xfc);
*(undefined4 *)(this + 0xfc) = 0;
}
if (*(int *)(this + 0x100) != 0) {
(**(code **)(*(int *)this + 0x214))(this,this + 0x100);
*(undefined4 *)(this + 0x100) = 0;
}
if (*(float *)(this + 0x1614) <= 0.0) {
if (*(int *)(this + 0x1620) != 2) {
if (this[0x6c] == (CFinaleTrigger)0x0) {
pCVar1 = *(CBaseEdict **)(this + 0x30);
if (pCVar1 != (CBaseEdict *)0x0) {
*(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
iVar3 = CBaseEdict::GetChangeAccessor(pCVar1);
*(undefined2 *)(iVar3 + 2) = 0;
}
}
else {
this[0x70] = (CFinaleTrigger)((byte)this[0x70] | 1);
}
*(undefined4 *)(this + 0x1620) = 2;
}
}
else if (*(int *)(this + 0x1620) != 0) {
if (this[0x6c] == (CFinaleTrigger)0x0) {
pCVar1 = *(CBaseEdict **)(this + 0x30);
if (pCVar1 != (CBaseEdict *)0x0) {
*(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
iVar3 = CBaseEdict::GetChangeAccessor(pCVar1);
*(undefined2 *)(iVar3 + 2) = 0;
}
}
else {
this[0x70] = (CFinaleTrigger)((byte)this[0x70] | 1);
}
*(undefined4 *)(this + 0x1620) = 0;
}
CBaseEntity::SetClassname((char *)this);
cVar2 = CTerrorGameRules::IsVersusMode();
if (cVar2 != '\0') {
CDirectorVersusMode::OnFinaleTriggerSpawned(*(CDirectorVersusMode **)(TheDirector + 0x63c));
}
CDirectorScriptedEventManager::OnFinaleTriggerSpawned
(*(CDirectorScriptedEventManager **)(TheDirector + 0x638));
return;
}
if (((byte)this[0x14d] & 8) == 0) {
dVar6 = (double)*(float *)(this + 0x2e8);
}
else {
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
dVar6 = (double)*(float *)(this + 0x2e8);
if (((byte)this[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
dVar5 = (double)*(float *)(this + 0x2e4);
if (((byte)this[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
}
goto LAB_004e8483;
}
}
dVar5 = (double)*(float *)(this + 0x2e4);
LAB_004e8483:
Warning("trigger_finale at %.0f %.0f %0.f missing modelname\n",(double)*(float *)(this + 0x2e0),
dVar5,dVar6);
UTIL_Remove((CBaseEntity *)this);
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.