CBasePlayer::ItemPostFrame
0x00418cb0 · 1227 bytes · __thiscall
_ZN11CBasePlayer13ItemPostFrameEv
Decompiled
undefined (1 param)
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* CBasePlayer::ItemPostFrame() */
void __thiscall CBasePlayer::ItemPostFrame(CBasePlayer *this)
{
uint uVar1;
CBaseEdict *pCVar2;
char cVar3;
QAngle *pQVar4;
int iVar5;
int *piVar6;
int iVar7;
undefined *puVar8;
undefined4 *puVar9;
undefined4 local_3c;
undefined4 local_38;
undefined4 local_34;
undefined4 local_30;
int local_2c;
Vector local_28 [24];
local_3c = 0;
local_38 = 0;
if (___atan2f_finite == 0) {
local_2c = 0;
}
else {
(**(code **)(___atan2f_finite + 0x50))
(___atan2f_finite,&local_3c,0,0,0,0,
"/data/src/game/server/../../game/shared/baseplayer_shared.cpp",0xc6,
&ItemPostFrame()::tm_fmt,"(%s)%s","Unaccounted","CBasePlayer::ItemPostFrame");
local_2c = ___atan2f_finite;
}
iVar5 = _DAT_0105db00;
local_34 = local_3c;
local_30 = local_38;
/* try { // try from 00418e36 to 00418e84 has its CatchHandler @ 004191ca */
if (((_DAT_0105d154 != 0) || (DAT_0105d158 == '\0')) &&
(iVar7 = ThreadGetCurrentId(), iVar5 == iVar7)) {
if ((char *)*_DAT_0105d15c != "CBasePlayer::ItemPostFrame") {
_DAT_0105d15c =
(int *)CVProfNode::GetSubNode((char *)_DAT_0105d15c,0xc0a65b,(char *)0x1,0xbfafa1);
}
CVProfNode::EnterScope();
DAT_0105d158 = '\0';
}
/* try { // try from 00418d69 to 00418dcb has its CatchHandler @ 004191a9 */
pQVar4 = (QAngle *)(**(code **)(*(int *)this + 0x238))(this);
(**(code **)(*(int *)this + 0x234))(local_28,this);
CalcViewModelView(this,local_28,pQVar4);
iVar5 = (**(code **)(*(int *)this + 0x500))(this);
if (iVar5 != 0) {
piVar6 = (int *)(**(code **)(*(int *)this + 0x500))(this);
cVar3 = UsingStandardWeaponsInVehicle(this);
(**(code **)(*piVar6 + 0x1c))(piVar6,this);
/* try { // try from 00418ee5 to 0041907a has its CatchHandler @ 004191a9 */
if ((cVar3 == '\0') || (iVar5 = (**(code **)(*(int *)this + 0x500))(this), iVar5 == 0))
goto LAB_00418dd6;
}
uVar1 = *(uint *)(this + 0x1d14);
if (((uVar1 == 0xffffffff) ||
((puVar8 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar8 == (undefined *)0xfffffffc ||
(*(uint *)(puVar8 + 8) != uVar1 >> 0xc)))) || (*(int *)(puVar8 + 4) == 0)) {
if (*(float *)(this + 0x17dc) < *(float *)(gpGlobals + 0xc) ||
*(float *)(this + 0x17dc) == *(float *)(gpGlobals + 0xc)) {
/* try { // try from 004190f0 to 0041914f has its CatchHandler @ 004191a9 */
iVar5 = CBaseCombatCharacter::GetActiveWeapon((CBaseCombatCharacter *)this);
if ((iVar5 != 0) &&
((cVar3 = (**(code **)(*(int *)this + 0x4fc))(this), cVar3 == '\0' ||
(cVar3 = UsingStandardWeaponsInVehicle(this), cVar3 != '\0')))) {
piVar6 = (int *)CBaseCombatCharacter::GetActiveWeapon((CBaseCombatCharacter *)this);
(**(code **)(*piVar6 + 0x444))(piVar6);
}
}
else {
iVar5 = CBaseCombatCharacter::GetActiveWeapon((CBaseCombatCharacter *)this);
if (iVar5 != 0) {
piVar6 = (int *)CBaseCombatCharacter::GetActiveWeapon((CBaseCombatCharacter *)this);
(**(code **)(*piVar6 + 0x448))(piVar6);
}
}
(**(code **)(*(int *)this + 0x62c))(this);
piVar6 = (int *)CBaseCombatCharacter::GetActiveWeapon((CBaseCombatCharacter *)this);
if ((piVar6 != (int *)0x0) &&
(cVar3 = (**(code **)(*(int *)this + 0x61c))(this,piVar6), cVar3 != '\0')) {
iVar5 = (**(code **)(*piVar6 + 0x510))(piVar6);
if (iVar5 != piVar6[0x508]) {
if ((char)piVar6[0x1b] == '\0') {
pCVar2 = (CBaseEdict *)piVar6[0xc];
if (pCVar2 != (CBaseEdict *)0x0) {
*(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
iVar7 = CBaseEdict::GetChangeAccessor(pCVar2);
*(undefined2 *)(iVar7 + 2) = 0;
}
}
else {
*(byte *)(piVar6 + 0x1c) = *(byte *)(piVar6 + 0x1c) | 1;
}
piVar6[0x508] = iVar5;
}
iVar5 = (**(code **)(*piVar6 + 0x55c))(piVar6);
if (-1 < iVar5) {
puVar9 = (undefined4 *)GetAmmoDef();
iVar7 = (**(code **)*puVar9)(puVar9,iVar5,this);
if (0 < iVar7) {
CBaseCombatCharacter::SetAmmoCount((CBaseCombatCharacter *)this,iVar7,iVar5);
}
}
iVar5 = (**(code **)(*piVar6 + 0x514))(piVar6);
if (iVar5 != piVar6[0x509]) {
if ((char)piVar6[0x1b] == '\0') {
pCVar2 = (CBaseEdict *)piVar6[0xc];
if (pCVar2 != (CBaseEdict *)0x0) {
*(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
iVar7 = CBaseEdict::GetChangeAccessor(pCVar2);
*(undefined2 *)(iVar7 + 2) = 0;
}
}
else {
*(byte *)(piVar6 + 0x1c) = *(byte *)(piVar6 + 0x1c) | 1;
}
piVar6[0x509] = iVar5;
}
iVar5 = (**(code **)(*piVar6 + 0x560))(piVar6);
if (-1 < iVar5) {
puVar9 = (undefined4 *)GetAmmoDef();
iVar7 = (**(code **)*puVar9)(puVar9,iVar5,this);
CBaseCombatCharacter::SetAmmoCount((CBaseCombatCharacter *)this,iVar7,iVar5);
}
}
iVar5 = _DAT_0105db00;
if (((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) &&
(iVar7 = ThreadGetCurrentId(), iVar5 == iVar7)) {
cVar3 = CVProfNode::ExitScope();
if (cVar3 != '\0') {
_DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
}
DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
}
if (local_2c == 0) {
return;
}
(**(code **)(local_2c + 0x54))(local_2c,local_34,local_30,0,0,0);
return;
}
(**(code **)(*(int *)this + 0x62c))(this);
LAB_00418dd6:
iVar5 = _DAT_0105db00;
if (((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) &&
(iVar7 = ThreadGetCurrentId(), iVar5 == iVar7)) {
cVar3 = CVProfNode::ExitScope();
if (cVar3 != '\0') {
_DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
}
DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
}
if (local_2c != 0) {
(**(code **)(local_2c + 0x54))(local_2c,local_34,local_30,0,0,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.