CWeaponCSBaseGun::Reload
0x00442300 · 313 bytes · __thiscall
_ZN16CWeaponCSBaseGun6ReloadEv
Decompiled
undefined (1 param)
/* CWeaponCSBaseGun::Reload() */
undefined4 __thiscall CWeaponCSBaseGun::Reload(CWeaponCSBaseGun *this)
{
code *pcVar1;
CBaseEdict *this_00;
CBaseCombatCharacter *this_01;
int iVar2;
undefined4 uVar3;
undefined4 uVar4;
int iVar5;
this_01 = (CBaseCombatCharacter *)CTerrorWeapon::GetPlayerOwner((CTerrorWeapon *)this);
if (this_01 != (CBaseCombatCharacter *)0x0) {
iVar2 = (**(code **)(*(int *)this + 0x55c))(this);
iVar2 = CBaseCombatCharacter::GetAmmoCount(this_01,iVar2);
if (0 < iVar2) {
pcVar1 = *(code **)(*(int *)this + 0x5fc);
uVar3 = (**(code **)(*(int *)this + 0x514))(this);
uVar4 = (**(code **)(*(int *)this + 0x510))(this);
uVar3 = (*pcVar1)(this,uVar4,uVar3,0xc1);
if ((char)uVar3 != '\0') {
(**(code **)(*(int *)this_01 + 0x620))(this_01,7);
iVar2 = CBasePlayer::GetFOV((CBasePlayer *)this_01);
iVar5 = CBasePlayer::GetDefaultFOV((CBasePlayer *)this_01);
if (iVar2 != iVar5) {
iVar2 = CBasePlayer::GetDefaultFOV((CBasePlayer *)this_01);
CBasePlayer::SetFOV((CBasePlayer *)this_01,(CBaseEntity *)this_01,iVar2,0.0,0);
}
*(undefined4 *)(this + 0x14f4) = 0x3e4ccccd;
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;
}
this[0x14f0] = (CWeaponCSBaseGun)0x0;
CCSPlayer::SetShieldDrawnState(SUB41(this_01,0));
return uVar3;
}
}
}
return 0;
}
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.