summaryrefslogtreecommitdiff
path: root/game/shared/cstrike/cs_ammodef.cpp
diff options
context:
space:
mode:
authorFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
committerFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
commit3bf9df6b2785fa6d951086978a3e66f49427166a (patch)
tree2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /game/shared/cstrike/cs_ammodef.cpp
downloadarchived-source-engine-2018-hl2-src-master.tar.xz
archived-source-engine-2018-hl2-src-master.zip
Diffstat (limited to 'game/shared/cstrike/cs_ammodef.cpp')
-rw-r--r--game/shared/cstrike/cs_ammodef.cpp57
1 files changed, 57 insertions, 0 deletions
diff --git a/game/shared/cstrike/cs_ammodef.cpp b/game/shared/cstrike/cs_ammodef.cpp
new file mode 100644
index 0000000..1b444d1
--- /dev/null
+++ b/game/shared/cstrike/cs_ammodef.cpp
@@ -0,0 +1,57 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose:
+//
+//=============================================================================//
+
+#include "cbase.h"
+#include "cs_ammodef.h"
+
+// memdbgon must be the last include file in a .cpp file!!!
+#include "tier0/memdbgon.h"
+
+//-----------------------------------------------------------------------------
+void CCSAmmoDef::AddAmmoCost( char const* name, int cost, int buySize )
+{
+ int index = Index( name );
+ if ( index < 1 || index >= m_nAmmoIndex )
+ return;
+
+ m_csAmmo[index].buySize = buySize;
+ m_csAmmo[index].cost = cost;
+}
+
+
+//-----------------------------------------------------------------------------
+int CCSAmmoDef::GetBuySize( int index ) const
+{
+ if ( index < 1 || index >= m_nAmmoIndex )
+ return 0;
+
+ return m_csAmmo[index].buySize;
+}
+
+
+//-----------------------------------------------------------------------------
+int CCSAmmoDef::GetCost( int index ) const
+{
+ if ( index < 1 || index >= m_nAmmoIndex )
+ return 0;
+
+ return m_csAmmo[index].cost;
+}
+
+
+//-----------------------------------------------------------------------------
+CCSAmmoDef::CCSAmmoDef(void)
+{
+ memset( m_csAmmo, 0, sizeof( m_csAmmo ) );
+}
+
+
+//-----------------------------------------------------------------------------
+CCSAmmoDef::~CCSAmmoDef( void )
+{
+}
+
+//-----------------------------------------------------------------------------