CMomentaryRotButton::Use
0x00639570 · 762 bytes · __cdecl
_ZN19CMomentaryRotButton3UseEP11CBaseEntityS1_8USE_TYPEf
Decompiled
undefined (4 params)
/* CMomentaryRotButton::Use(CBaseEntity*, CBaseEntity*, USE_TYPE, float) */
void CMomentaryRotButton::Use(CMomentaryRotButton *param_1,CBaseEntity *param_2)
{
float fVar1;
uint uVar2;
char cVar3;
CBaseEntity *pCVar4;
undefined *puVar5;
bool bVar6;
longdouble lVar7;
undefined1 local_44 [20];
float local_30 [3];
undefined4 local_24;
undefined4 local_20;
if (param_1[0x58d] == (CMomentaryRotButton)0x0) {
if (param_1[0x4f4] == (CMomentaryRotButton)0x0) {
bVar6 = false;
if (*(int *)(param_1 + 0x608) == 0) {
uVar2 = *(uint *)(param_1 + 0x494);
pCVar4 = (CBaseEntity *)0x0;
*(int *)(param_1 + 0x630) = -*(int *)(param_1 + 0x630);
if (((uVar2 != 0xffffffff) &&
(puVar5 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar5 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar5 + 8) == uVar2 >> 0xc)) {
pCVar4 = *(CBaseEntity **)(puVar5 + 4);
}
bVar6 = true;
COutputEvent::FireOutput
((COutputEvent *)(param_1 + 0x520),pCVar4,(CBaseEntity *)param_1,0.0);
}
*(undefined4 *)(param_1 + 0x608) = 1;
lVar7 = (longdouble)GetPos(param_1,(QAngle *)(param_1 + 0x3a8));
UpdateSelf(param_1,(float)lVar7,bVar6);
if (*(int *)(param_1 + 0x1c) == 0) {
CBaseEntity::ThinkSet((_func_void *)local_44,(float)param_1,(char *)UpdateThink);
CBaseEntity::SetNextThink((CBaseEntity *)param_1,*(float *)(gpGlobals + 0xc),(char *)0x0);
}
}
else {
cVar3 = CBaseButton::OnUseLocked((CBaseButton *)param_1,param_2);
if ((cVar3 != '\0') && (((byte)param_1[0x149] & 0x20) != 0)) {
fVar1 = *(float *)(param_1 + 0x444);
CEventQueue::AddEvent
((CEventQueue *)g_EventQueue,(CBaseEntity *)param_1,"_DisableUpdateTarget",0.0,
(CBaseEntity *)param_1,(CBaseEntity *)param_1,0);
local_24 = 0xffffffff;
local_20 = 1;
local_30[0] = 2.0 / fVar1;
CEventQueue::AddEvent
((CEventQueue *)g_EventQueue,param_1,"SetPosition",local_30,0x3c23d70a,param_1,
param_1,0);
local_30[0] = 0.0;
local_24 = 0xffffffff;
local_20 = 1;
CEventQueue::AddEvent
((CEventQueue *)g_EventQueue,param_1,"SetPosition",local_30,0x3dcccccd,param_1,
param_1,0);
local_30[0] = (2.0 / fVar1) * 0.5;
local_24 = 0xffffffff;
local_20 = 1;
CEventQueue::AddEvent
((CEventQueue *)g_EventQueue,param_1,"SetPosition",local_30,0x3e4ccccd,param_1,
param_1,0);
local_30[0] = 0.0;
local_24 = 0xffffffff;
local_20 = 1;
CEventQueue::AddEvent
((CEventQueue *)g_EventQueue,param_1,"SetPosition",local_30,0x3e99999a,param_1,
param_1,0);
CEventQueue::AddEvent
((CEventQueue *)g_EventQueue,(CBaseEntity *)param_1,"_EnableUpdateTarget",0.5,
(CBaseEntity *)param_1,(CBaseEntity *)param_1,0);
}
}
}
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.