CWeaponCSBase::DefaultPistolReload
0x00440920 · 202 bytes · __thiscall
_ZN13CWeaponCSBase19DefaultPistolReloadEv
Decompiled
undefined (1 param)
/* CWeaponCSBase::DefaultPistolReload() */
undefined4 __thiscall CWeaponCSBase::DefaultPistolReload(CWeaponCSBase *this)
{
code *pcVar1;
CBaseEdict *this_00;
CBaseCombatCharacter *this_01;
int iVar2;
undefined4 uVar3;
this_01 = (CBaseCombatCharacter *)GetPlayerOwner(this);
if (this_01 == (CBaseCombatCharacter *)0x0) {
return 0;
}
iVar2 = (**(code **)(*(int *)this + 0x55c))(this);
iVar2 = CBaseCombatCharacter::GetAmmoCount(this_01,iVar2);
if (0 < iVar2) {
pcVar1 = *(code **)(*(int *)this + 0x5fc);
iVar2 = CBaseCombatWeapon::GetWpnData((CBaseCombatWeapon *)this);
uVar3 = (*pcVar1)(this,*(undefined4 *)(iVar2 + 0x168),0,0xc1);
if ((char)uVar3 == '\0') {
return 0;
}
if (*(int *)(this_01 + 0x2850) != 0) {
if (this_01[0x6c] == (CBaseCombatCharacter)0x0) {
this_00 = *(CBaseEdict **)(this_01 + 0x30);
if (this_00 != (CBaseEdict *)0x0) {
*(uint *)this_00 = *(uint *)this_00 | 0x101;
iVar2 = CBaseEdict::GetChangeAccessor(this_00);
*(undefined2 *)(iVar2 + 2) = 0;
}
}
else {
this_01[0x70] = (CBaseCombatCharacter)((byte)this_01[0x70] | 1);
}
*(undefined4 *)(this_01 + 0x2850) = 0;
return uVar3;
}
}
return 1;
}
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.