CBaseButton::ButtonTouch
0x0063a1f0 · 722 bytes · __thiscall
_ZN11CBaseButton11ButtonTouchEP11CBaseEntity
Decompiled
undefined (2 params)
/* CBaseButton::ButtonTouch(CBaseEntity*) */
void __thiscall CBaseButton::ButtonTouch(CBaseButton *this,CBaseEntity *param_1)
{
uint uVar1;
char cVar2;
undefined4 *puVar3;
int iVar4;
CBaseEntity *pCVar5;
undefined *puVar6;
int *piVar7;
undefined **local_80 [8];
undefined4 local_60;
undefined1 *local_5c;
undefined4 local_58;
undefined4 local_54;
undefined4 local_50;
undefined4 local_4c;
undefined4 local_48;
undefined4 local_44;
undefined4 local_40;
undefined1 local_3c;
undefined1 local_3b;
undefined1 local_3a;
undefined4 local_38;
undefined4 local_34;
undefined4 local_30;
undefined4 local_2c;
undefined4 local_28;
undefined4 local_24;
undefined2 local_20;
piVar7 = (int *)&stack0xffffff64;
cVar2 = (**(code **)(*(int *)param_1 + 0x16c))();
if (cVar2 != '\0') {
puVar3 = (undefined4 *)(**(code **)(*(int *)param_1 + 0xc))();
*(undefined4 *)(this + 0x494) = *puVar3;
iVar4 = ButtonResponseToTouch(this);
if (iVar4 != 0) {
cVar2 = UTIL_IsMasterTriggered();
if ((cVar2 == '\0') || (this[0x4f4] != (CBaseButton)0x0)) {
PlayLockSounds((CBaseEntity *)this,(locksound_t *)(this + 0x4c8),1,1);
return;
}
*(undefined4 *)(this + 0xd8) = 0;
*(undefined4 *)(this + 0xdc) = 0;
if (iVar4 != 2) {
uVar1 = *(uint *)(this + 0x494);
pCVar5 = (CBaseEntity *)0x0;
if (((uVar1 != 0xffffffff) &&
(puVar6 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar6 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar6 + 8) == uVar1 >> 0xc)) {
pCVar5 = *(CBaseEntity **)(puVar6 + 4);
}
COutputEvent::FireOutput((COutputEvent *)(this + 0x520),pCVar5,(CBaseEntity *)this,0.0);
ButtonActivate(this);
return;
}
if (*(int *)(this + 0x504) != 0) {
(**(code **)(*(int *)this + 0x28c))();
CRecipientFilter::CRecipientFilter((CRecipientFilter *)local_80);
local_80[0] = &PTR__CPASFilter_00bfaf28;
/* try { // try from 0063a354 to 0063a358 has its CatchHandler @ 0063a4ff */
CRecipientFilter::AddRecipientsByPAS((CRecipientFilter *)local_80,(Vector *)&local_60);
local_80[0] = &PTR__CPASAttenuationFilter_00c08ec8;
/* try { // try from 0063a369 to 0063a385 has its CatchHandler @ 0063a4fb */
(**(code **)(*(int *)this + 0x28c))();
piVar7 = (int *)&stack0xffffff5c;
CPASAttenuationFilter::Filter((CPASAttenuationFilter *)local_80,(Vector *)&local_60,0.8);
local_3c = 1;
local_20 = 0xffff;
local_58 = 0x3f800000;
local_50 = 0;
local_4c = 100;
local_5c = &DAT_00d539c2;
if (*(undefined1 **)(this + 0x504) != (undefined1 *)0x0) {
local_5c = *(undefined1 **)(this + 0x504);
}
local_48 = 0;
local_44 = 0;
local_40 = 0;
local_3b = 0;
local_3a = 0;
local_38 = 0xffffffff;
local_34 = 0;
local_30 = 0;
local_2c = 0;
local_28 = 0;
local_24 = 0;
local_60 = 2;
local_54 = 0x4b;
if (*(int *)(this + 0x30) == 0) {
iVar4 = 0;
}
else {
iVar4 = *(int *)(this + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
}
/* try { // try from 0063a432 to 0063a436 has its CatchHandler @ 0063a4d7 */
CBaseEntity::EmitSound((IRecipientFilter *)local_80,iVar4,(EmitSound_t *)&local_60);
local_28 = 0;
CUtlMemory<Vector,int>::Purge((CUtlMemory<Vector,int> *)&local_34);
local_24 = local_34;
CUtlMemory<Vector,int>::Purge((CUtlMemory<Vector,int> *)&local_34);
local_80[0] = &PTR__CPASFilter_00bfaf28;
CRecipientFilter::~CRecipientFilter((CRecipientFilter *)local_80);
}
uVar1 = *(uint *)(this + 0x494);
if (((uVar1 == 0xffffffff) ||
(puVar6 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar6 == (undefined *)0xfffffffc)) ||
(*(uint *)(puVar6 + 8) != uVar1 >> 0xc)) {
iVar4 = 0;
}
else {
iVar4 = *(int *)(puVar6 + 4);
}
piVar7[1] = iVar4;
piVar7[3] = 0;
piVar7[2] = (int)this;
*piVar7 = (int)(this + 0x520);
piVar7[-1] = 0x63a4b3;
COutputEvent::FireOutput
((COutputEvent *)*piVar7,(CBaseEntity *)piVar7[1],(CBaseEntity *)piVar7[2],
(float)piVar7[3]);
*piVar7 = (int)this;
piVar7[-1] = 0x63a4bb;
ButtonReturn((CBaseButton *)*piVar7);
}
}
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.