CBaseCSGrenade::ItemPostFrame
0x0043d880 · 1565 bytes · __thiscall
_ZN14CBaseCSGrenade13ItemPostFrameEv
Decompiled
undefined (1 param)
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* CBaseCSGrenade::ItemPostFrame() */
void __thiscall CBaseCSGrenade::ItemPostFrame(CBaseCSGrenade *this)
{
CBaseEdict *pCVar1;
byte *pbVar2;
code *pcVar3;
int *piVar4;
undefined4 uVar5;
undefined4 uVar6;
char cVar7;
CBasePlayer *this_00;
int iVar8;
int *piVar9;
undefined4 uVar10;
int iVar11;
byte *pbVar12;
byte *pbVar13;
bool bVar14;
bool bVar15;
byte bVar16;
float fVar17;
byte *local_40;
int local_30;
undefined4 local_24;
undefined4 local_20;
bVar16 = 0;
local_24 = 0;
local_20 = 0;
if (___atan2f_finite == 0) {
local_30 = 0;
}
else {
(**(code **)(___atan2f_finite + 0x50))
(___atan2f_finite,&local_24,0,0,0,0,
"/data/src/game/server/../../game/shared/cstrike/weapon_basecsgrenade.cpp",0x116,
&ItemPostFrame()::tm_fmt,"(%s)%s","Unaccounted","CBaseCSGrenade::ItemPostFrame");
local_30 = ___atan2f_finite;
}
uVar6 = local_20;
uVar5 = local_24;
iVar8 = _DAT_0105db00;
/* try { // try from 0043d9ce to 0043da1c has its CatchHandler @ 0043df75 */
if (((_DAT_0105d154 != 0) || (DAT_0105d158 == '\0')) &&
(iVar11 = ThreadGetCurrentId(), iVar8 == iVar11)) {
if ((char *)*_DAT_0105d15c != "CBaseCSGrenade::ItemPostFrame") {
_DAT_0105d15c =
(int *)CVProfNode::GetSubNode((char *)_DAT_0105d15c,0xc0f5c0,(char *)0x1,0xbfafa1);
}
CVProfNode::EnterScope();
DAT_0105d158 = '\0';
}
/* try { // try from 0043d936 to 0043d9b1 has its CatchHandler @ 0043ded4 */
this_00 = (CBasePlayer *)CTerrorWeapon::GetPlayerOwner((CTerrorWeapon *)this);
if ((this_00 == (CBasePlayer *)0x0) ||
(iVar8 = CBasePlayer::GetViewModel(this_00,*(int *)(this + 0x13f8)), iVar8 == 0)) {
LAB_0043dd60:
iVar8 = _DAT_0105db00;
if (((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) &&
(iVar11 = ThreadGetCurrentId(), iVar8 == iVar11)) {
cVar7 = CVProfNode::ExitScope();
if (cVar7 != '\0') {
_DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
}
DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
}
if (local_30 != 0) {
(**(code **)(local_30 + 0x54))(local_30,uVar5,uVar6,0,0,0);
}
}
else {
fVar17 = *(float *)(gpGlobals + 0xc);
if (*(float *)(this + 0x13fc) <= fVar17) {
if ((this[0x17dd] == (CBaseCSGrenade)0x0) || ((*(uint *)(this_00 + 0x1cb0) & 0x801) != 0))
goto LAB_0043dc90;
/* try { // try from 0043da68 to 0043da89 has its CatchHandler @ 0043ded4 */
(**(code **)(*(int *)this_00 + 0x7fc))(this_00,0x3d,0);
(**(code **)(*(int *)this + 0x708))(this);
piVar4 = mdlcache;
(**(code **)(*mdlcache + 0x68))(mdlcache);
if (this[0x17dd] != (CBaseCSGrenade)0x0) {
if (this[0x6c] == (CBaseCSGrenade)0x0) {
pCVar1 = *(CBaseEdict **)(this + 0x30);
if (pCVar1 != (CBaseEdict *)0x0) {
*(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
/* try { // try from 0043daad to 0043dc1f has its CatchHandler @ 0043df63 */
iVar8 = CBaseEdict::GetChangeAccessor(pCVar1);
*(undefined2 *)(iVar8 + 2) = 0;
}
}
else {
this[0x70] = (CBaseCSGrenade)((byte)this[0x70] | 1);
}
this[0x17dd] = (CBaseCSGrenade)0x0;
}
(**(code **)(*(int *)this + 0x3f0))(this,0xbc);
(**(code **)(*(int *)this + 0x404))(this,*(float *)(gpGlobals + 0xc) + 1.3);
fVar17 = *(float *)(gpGlobals + 0xc) + 1.3;
if (fVar17 != *(float *)(this + 0x13fc)) {
if (this[0x6c] == (CBaseCSGrenade)0x0) {
pCVar1 = *(CBaseEdict **)(this + 0x30);
if (pCVar1 != (CBaseEdict *)0x0) {
*(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
iVar8 = CBaseEdict::GetChangeAccessor(pCVar1);
*(undefined2 *)(iVar8 + 2) = 0;
}
}
else {
this[0x70] = (CBaseCSGrenade)((byte)this[0x70] | 1);
}
*(float *)(this + 0x13fc) = fVar17;
}
piVar9 = (int *)(**(code **)(*gameeventmanager + 0x1c))(gameeventmanager,"weapon_fire",0,0);
if (piVar9 != (int *)0x0) {
pbVar2 = *(byte **)(this + 0x7c);
bVar14 = false;
if (pbVar2 == (byte *)0x0) {
local_40 = &DAT_00d539c2;
}
else {
iVar8 = 7;
bVar15 = false;
pbVar12 = pbVar2;
pbVar13 = (byte *)"weapon_";
do {
if (iVar8 == 0) break;
iVar8 = iVar8 + -1;
bVar14 = *pbVar12 < *pbVar13;
bVar15 = *pbVar12 == *pbVar13;
pbVar12 = pbVar12 + (uint)bVar16 * -2 + 1;
pbVar13 = pbVar13 + (uint)bVar16 * -2 + 1;
} while (bVar15);
local_40 = pbVar2 + 7;
if ((!bVar14 && !bVar15) != bVar14) {
local_40 = pbVar2;
}
}
pcVar3 = *(code **)(*piVar9 + 0x30);
uVar10 = (**(code **)(*engine + 0x40))(engine,*(undefined4 *)(this_00 + 0x30));
(*pcVar3)(piVar9,"userid",uVar10);
(**(code **)(*piVar9 + 0x3c))(piVar9,"weapon",local_40);
pcVar3 = *(code **)(*piVar9 + 0x30);
uVar10 = (**(code **)(*(int *)this + 0x638))(this);
(*pcVar3)(piVar9,"weaponid",uVar10);
(**(code **)(*gameeventmanager + 0x20))(gameeventmanager,piVar9,0);
}
(**(code **)(*piVar4 + 0x6c))(piVar4);
}
else if ((this[0x17dd] == (CBaseCSGrenade)0x0) || (this[0x17de] != (CBaseCSGrenade)0x0)) {
LAB_0043dc90:
if ((*(float *)(this + 0x17e0) <= 0.0) || (fVar17 <= *(float *)(this + 0x17e0))) {
if (this[0x17dc] == (CBaseCSGrenade)0x0) {
/* try { // try from 0043de20 to 0043de24 has its CatchHandler @ 0043ded4 */
CTerrorWeapon::ItemPostFrame((CTerrorWeapon *)this);
}
else if (*(float *)(this + 0x142c) <= fVar17 && fVar17 != *(float *)(this + 0x142c)) {
iVar8 = CBaseCombatCharacter::GetAmmoCount
((CBaseCombatCharacter *)this_00,*(int *)(this + 0x1418));
if (iVar8 < 1) {
/* try { // try from 0043deb8 to 0043dec5 has its CatchHandler @ 0043ded4 */
(**(code **)(*(int *)this_00 + 0x470))(this_00,this,0,0);
UTIL_Remove((CBaseEntity *)this);
}
else {
cVar7 = CBaseCombatCharacter::SwitchToNextBestWeapon
((CBaseCombatCharacter *)this_00,(CBaseCombatWeapon *)this);
if ((cVar7 == '\0') &&
((**(code **)(*(int *)this + 0x468))(this), this[0x17dc] != (CBaseCSGrenade)0x0)) {
if (this[0x6c] == (CBaseCSGrenade)0x0) {
pCVar1 = *(CBaseEdict **)(this + 0x30);
if (pCVar1 != (CBaseEdict *)0x0) {
*(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
iVar8 = CBaseEdict::GetChangeAccessor(pCVar1);
*(undefined2 *)(iVar8 + 2) = 0;
}
}
else {
this[0x70] = (CBaseCSGrenade)((byte)this[0x70] | 1);
}
this[0x17dc] = (CBaseCSGrenade)0x0;
}
}
goto LAB_0043dd60;
}
}
else {
/* try { // try from 0043dcc8 to 0043dd4f has its CatchHandler @ 0043ded4 */
(**(code **)(*(int *)this_00 + 0x450))(this_00,1,*(undefined4 *)(this + 0x1418));
(**(code **)(*(int *)this + 0x70c))(this);
}
}
else {
if (this[0x6c] == (CBaseCSGrenade)0x0) {
pCVar1 = *(CBaseEdict **)(this + 0x30);
if (pCVar1 != (CBaseEdict *)0x0) {
*(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
iVar8 = CBaseEdict::GetChangeAccessor(pCVar1);
*(undefined2 *)(iVar8 + 2) = 0;
}
}
else {
this[0x70] = (CBaseCSGrenade)((byte)this[0x70] | 1);
}
this[0x17de] = (CBaseCSGrenade)0x1;
}
iVar8 = _DAT_0105db00;
if (((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) &&
(iVar11 = ThreadGetCurrentId(), iVar8 == iVar11)) {
cVar7 = CVProfNode::ExitScope();
if (cVar7 != '\0') {
_DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
}
DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
}
if (local_30 != 0) {
(**(code **)(local_30 + 0x54))(local_30,uVar5,uVar6,0,0,0);
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.