CEnvInstructorHint::InputShowHint
0x00691d50 · 1134 bytes · __thiscall
_ZN18CEnvInstructorHint13InputShowHintER11inputdata_t
Decompiled
undefined (2 params)
/* CEnvInstructorHint::InputShowHint(inputdata_t&) */
void __thiscall CEnvInstructorHint::InputShowHint(CEnvInstructorHint *this,inputdata_t *param_1)
{
CEnvInstructorHint CVar1;
int *piVar2;
char *pcVar3;
int iVar4;
uint uVar5;
uint uVar6;
int iVar7;
undefined4 uVar8;
undefined1 *puVar9;
uint uVar10;
code *pcVar11;
int in_GS_OFFSET;
char local_a0 [128];
int local_20;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
piVar2 = (int *)(**(code **)(*gameeventmanager + 0x1c))
(gameeventmanager,"instructor_server_hint_create",0,
&InputShowHint(inputdata_t&)::s_InstructorServerHintEventCreate);
if (piVar2 == (int *)0x0) goto LAB_00692147;
pcVar3 = "";
if (*(char **)(this + 0x448) != (char *)0x0) {
pcVar3 = *(char **)(this + 0x448);
}
iVar4 = CGlobalEntityList::FindEntityByName
((CGlobalEntityList *)gEntList,(CBaseEntity *)0x0,pcVar3,(CBaseEntity *)0x0,
(CBaseEntity *)0x0,(CBaseEntity *)0x0,(IEntityFindFilter *)0x0);
V_snprintf(local_a0,0x80,"%.3d,%.3d,%.3d",(uint)(byte)this[0x460],(uint)(byte)this[0x461],
(uint)(byte)this[0x462]);
uVar5 = 0;
if (this[0x46c] != (CEnvInstructorHint)0x0) {
uVar5 = 1 << ((char)this[0x46c] - 1U & 0x1f);
}
uVar10 = 0;
if (this[0x46d] != (CEnvInstructorHint)0x0) {
uVar10 = 8 << ((char)this[0x46d] - 1U & 0x1f);
}
uVar6 = 0;
if (this[0x46e] != (CEnvInstructorHint)0x0) {
uVar6 = 0x40 << ((char)this[0x46e] - 1U & 0x1f);
}
CVar1 = this[0x46f];
if (*(int *)(this + 0x440) == 0) {
*(undefined4 *)(this + 0x440) = *(undefined4 *)(this + 0x154);
iVar7 = *(int *)param_1;
if (iVar7 != 0) goto LAB_00691e9a;
LAB_006921a0:
pcVar11 = *(code **)(*piVar2 + 0x30);
uVar8 = 0;
}
else {
iVar7 = *(int *)param_1;
if (iVar7 == 0) goto LAB_006921a0;
LAB_00691e9a:
iVar7 = __dynamic_cast(iVar7,&CBaseEntity::typeinfo,&CBasePlayer::typeinfo,0);
pcVar11 = *(code **)(*piVar2 + 0x30);
if (iVar7 == 0) {
uVar8 = 0;
}
else {
uVar8 = (**(code **)(*engine + 0x40))(engine,*(undefined4 *)(iVar7 + 0x30));
}
}
(*pcVar11)(piVar2,"userid",uVar8);
if (*(int *)(this + 0x30) == 0) {
iVar7 = 0;
}
else {
iVar7 = *(int *)(this + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
}
(**(code **)(*piVar2 + 0x30))(piVar2,"hint_entindex",iVar7);
puVar9 = &DAT_00d539c2;
if (*(undefined1 **)(this + 0x440) != (undefined1 *)0x0) {
puVar9 = *(undefined1 **)(this + 0x440);
}
(**(code **)(*piVar2 + 0x3c))(piVar2,"hint_name",puVar9);
if (iVar4 == 0) {
iVar4 = -1;
}
else if (*(int *)(iVar4 + 0x30) == 0) {
iVar4 = 0;
}
else {
iVar4 = *(int *)(iVar4 + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
}
(**(code **)(*piVar2 + 0x30))(piVar2,"hint_target",iVar4);
(**(code **)(*piVar2 + 0x30))(piVar2,"hint_timeout",*(undefined4 *)(this + 0x44c));
(**(code **)(*piVar2 + 0x30))(piVar2,"hint_display_limit",*(undefined4 *)(this + 0x450));
puVar9 = *(undefined1 **)(this + 0x454);
if (puVar9 == (undefined1 *)0x0) {
puVar9 = &DAT_00d539c2;
}
(**(code **)(*piVar2 + 0x3c))(piVar2,"hint_icon_onscreen",puVar9);
puVar9 = *(undefined1 **)(this + 0x458);
if (puVar9 == (undefined1 *)0x0) {
puVar9 = &DAT_00d539c2;
}
(**(code **)(*piVar2 + 0x3c))(piVar2,"hint_icon_offscreen",puVar9);
puVar9 = *(undefined1 **)(this + 0x45c);
if (puVar9 == (undefined1 *)0x0) {
puVar9 = &DAT_00d539c2;
}
(**(code **)(*piVar2 + 0x3c))(piVar2,"hint_caption",puVar9);
(**(code **)(*piVar2 + 0x3c))(piVar2,"hint_color",local_a0);
(**(code **)(*piVar2 + 0x38))(piVar2,"hint_icon_offset",*(undefined4 *)(this + 0x464));
(**(code **)(*piVar2 + 0x38))(piVar2,"hint_range",*(undefined4 *)(this + 0x468));
(**(code **)(*piVar2 + 0x30))
(piVar2,"hint_flags",
uVar10 | uVar5 | uVar6 | ~-(uint)(CVar1 == (CEnvInstructorHint)0x0) & 0x100);
puVar9 = &DAT_00d539c2;
if (*(undefined1 **)(this + 0x47c) != (undefined1 *)0x0) {
puVar9 = *(undefined1 **)(this + 0x47c);
}
(**(code **)(*piVar2 + 0x3c))(piVar2,"hint_binding",puVar9);
(**(code **)(*piVar2 + 0x2c))(piVar2,"hint_allow_nodraw_target",this[0x480]);
(**(code **)(*piVar2 + 0x2c))(piVar2,"hint_nooffscreen",this[0x470]);
(**(code **)(*piVar2 + 0x2c))(piVar2,"hint_forcecaption",this[0x471]);
(**(code **)(*piVar2 + 0x30))(piVar2,"hint_instance_type",*(undefined4 *)(this + 0x474));
(**(code **)(*piVar2 + 0x2c))(piVar2,"hint_suppress_rest",this[0x478]);
(**(code **)(*gameeventmanager + 0x20))(gameeventmanager,piVar2,0);
LAB_00692147:
if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
/* WARNING: Subroutine does not return */
__stack_chk_fail();
}
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.