CLogicAuto::Think
0x006e6520 · 442 bytes · __thiscall
_ZN10CLogicAuto5ThinkEv
Decompiled
undefined (1 param)
/* CLogicAuto::Think() */
void __thiscall CLogicAuto::Think(CLogicAuto *this)
{
char cVar1;
int iVar2;
if (*(char **)(this + 0x500) != (char *)0x0) {
iVar2 = GlobalEntity_GetIndex(*(char **)(this + 0x500));
iVar2 = GlobalEntity_GetState(iVar2);
if (iVar2 != 1) {
return;
}
}
iVar2 = *(int *)(gpGlobals + 0x48);
if (iVar2 == 2) {
COutputEvent::FireOutput
((COutputEvent *)(this + 0x4a0),(CBaseEntity *)0x0,(CBaseEntity *)this,0.0);
}
else if (iVar2 == 0) {
COutputEvent::FireOutput
((COutputEvent *)(this + 0x470),(CBaseEntity *)0x0,(CBaseEntity *)this,0.0);
}
else if (iVar2 == 1) {
COutputEvent::FireOutput
((COutputEvent *)(this + 0x488),(CBaseEntity *)0x0,(CBaseEntity *)this,0.0);
}
else if (iVar2 == 3) {
COutputEvent::FireOutput
((COutputEvent *)(this + 0x4b8),(CBaseEntity *)0x0,(CBaseEntity *)this,0.0);
}
COutputEvent::FireOutput
((COutputEvent *)(this + 0x440),(CBaseEntity *)0x0,(CBaseEntity *)this,0.0);
cVar1 = IsPressDemoMode();
if (cVar1 != '\0') {
COutputEvent::FireOutput
((COutputEvent *)(this + 0x458),(CBaseEntity *)0x0,(CBaseEntity *)this,0.0);
}
cVar1 = (**(code **)(*g_pGameRules + 0x88))(g_pGameRules);
if (cVar1 != '\0') {
cVar1 = (**(code **)(*g_pGameRules + 0x90))(g_pGameRules);
if (cVar1 == '\0') {
COutputEvent::FireOutput
((COutputEvent *)(this + 0x4d0),(CBaseEntity *)0x0,(CBaseEntity *)this,0.0);
}
else {
COutputEvent::FireOutput
((COutputEvent *)(this + 0x4e8),(CBaseEntity *)0x0,(CBaseEntity *)this,0.0);
}
}
if (((byte)this[0x148] & 1) == 0) {
return;
}
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.