CBasePlayer::SelectLastItem
0x00416cc0 · 270 bytes · __thiscall
_ZN11CBasePlayer14SelectLastItemEv
Decompiled
undefined (1 param)
/* CBasePlayer::SelectLastItem() */
void __thiscall CBasePlayer::SelectLastItem(CBasePlayer *this)
{
uint uVar1;
code *pcVar2;
char cVar3;
int iVar4;
int *piVar5;
undefined4 uVar6;
undefined *puVar7;
undefined1 *puVar8;
uVar1 = *(uint *)(this + 0x2064);
if ((((uVar1 != 0xffffffff) &&
(puVar7 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar7 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar7 + 8) == uVar1 >> 0xc)) && (*(int *)(puVar7 + 4) != 0)) {
iVar4 = CBaseCombatCharacter::GetActiveWeapon((CBaseCombatCharacter *)this);
if (iVar4 != 0) {
piVar5 = (int *)CBaseCombatCharacter::GetActiveWeapon((CBaseCombatCharacter *)this);
cVar3 = (**(code **)(*piVar5 + 0x418))(piVar5);
if (cVar3 == '\0') {
return;
}
}
piVar5 = (int *)0x0;
pcVar2 = *(code **)(*(int *)this + 0x6b4);
uVar1 = *(uint *)(this + 0x2064);
if (((uVar1 != 0xffffffff) &&
(puVar7 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar7 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar7 + 8) == uVar1 >> 0xc)) {
piVar5 = *(int **)(puVar7 + 4);
}
iVar4 = 0;
uVar6 = (**(code **)(*piVar5 + 0x3a8))(piVar5);
uVar1 = *(uint *)(this + 0x2064);
if (((uVar1 != 0xffffffff) &&
(puVar7 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar7 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar7 + 8) == uVar1 >> 0xc)) {
iVar4 = *(int *)(puVar7 + 4);
}
puVar8 = &DAT_00d539c2;
if (*(undefined1 **)(iVar4 + 0x7c) != (undefined1 *)0x0) {
puVar8 = *(undefined1 **)(iVar4 + 0x7c);
}
(*pcVar2)(this,puVar8,uVar6);
return;
}
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.