Skip to content

Commit dabe64e

Browse files
committed
server: code cleanup and minor fixes according to weapon predicting
1 parent 6af5f24 commit dabe64e

File tree

3 files changed

+2
-36
lines changed

3 files changed

+2
-36
lines changed

server/client.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1718,16 +1718,6 @@ void UpdateClientData ( const struct edict_s *ent, int sendweapons, struct clien
17181718
if (sendweapons && player)
17191719
{
17201720
cd->m_flNextAttack = player->m_flNextAttack;
1721-
//cd->fuser2 = player->m_flNextAmmoBurn;
1722-
//cd->fuser3 = player->m_flAmmoStartCharge;
1723-
//cd->vuser1.x = player->ammo_9mm;
1724-
//cd->vuser1.y = player->ammo_357;
1725-
//cd->vuser1.z = player->ammo_argrens;
1726-
//cd->ammo_nails = player->ammo_bolts;
1727-
//cd->ammo_shells = player->ammo_buckshot;
1728-
//cd->ammo_rockets = player->ammo_rockets;
1729-
//cd->ammo_cells = player->ammo_uranium;
1730-
//cd->vuser2.x = player->ammo_hornets;
17311721

17321722
CBasePlayerItem *item = player->m_pActiveItem;
17331723
if (item)

server/player.cpp

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2593,22 +2593,6 @@ void CBasePlayer::UpdatePlayerTimers()
25932593
m_flNextAttack -= gpGlobals->frametime;
25942594
if ( m_flNextAttack < -0.001 )
25952595
m_flNextAttack = -0.001;
2596-
2597-
//if ( m_flNextAmmoBurn != 1000 )
2598-
//{
2599-
// m_flNextAmmoBurn -= gpGlobals->frametime;
2600-
//
2601-
// if ( m_flNextAmmoBurn < -0.001 )
2602-
// m_flNextAmmoBurn = -0.001;
2603-
//}
2604-
2605-
//if ( m_flAmmoStartCharge != 1000 )
2606-
//{
2607-
// m_flAmmoStartCharge -= gpGlobals->frametime;
2608-
//
2609-
// if ( m_flAmmoStartCharge < -0.001 )
2610-
// m_flAmmoStartCharge = -0.001;
2611-
//}
26122596
}
26132597

26142598
void CBasePlayer::UpdateWeaponTimers()
@@ -2651,12 +2635,6 @@ void CBasePlayer::UpdateWeaponTimers()
26512635
pGauss->m_flAmmoStartCharge = std::max(pGauss->m_flAmmoStartCharge - gpGlobals->frametime, -0.001f);
26522636
}
26532637
}
2654-
2655-
// Only decrement if not flagged as NO_DECREMENT
2656-
// if ( gun->m_flPumpTime != 1000 )
2657-
// {
2658-
// gun->m_flPumpTime = max( gun->m_flPumpTime - gpGlobals->frametime, -0.001f );
2659-
// }
26602638
}
26612639
pPlayerItem = pPlayerItem->m_pNext;
26622640
}

server/weapons.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,10 +122,6 @@ class CBasePlayerWeapon : public CBasePlayerItem
122122
virtual int AddDuplicate( CBasePlayerItem *pItem ) override;
123123

124124
int UpdateClientData( CBasePlayer *pPlayer ) override; // sends hud info to client dll, if things have changed
125-
126-
// declare it here, but in future move to the bottom
127-
std::unique_ptr<CBaseWeaponContext> m_pWeaponContext;
128-
129125
virtual void ItemPostFrame() override; // called each frame by the player PostThink
130126

131127
int PrimaryAmmoIndex() override { return m_pWeaponContext->PrimaryAmmoIndex(); }; // forward to weapon logic
@@ -153,6 +149,8 @@ class CBasePlayerWeapon : public CBasePlayerItem
153149
int iFlags() override { return m_pWeaponContext->iFlags(); }
154150
int iWeaponID() override { return m_pWeaponContext->m_iId; }
155151

152+
std::unique_ptr<CBaseWeaponContext> m_pWeaponContext;
153+
156154
protected:
157155
int ExtractAmmo( CBasePlayerWeapon *pWeapon ); // Return TRUE if you can add ammo to yourself when picked up
158156
int ExtractClipAmmo( CBasePlayerWeapon *pWeapon ); // Return TRUE if you can add ammo to yourself when picked up

0 commit comments

Comments
 (0)