blob: 1b444d197033590f19921d700e716cd107be4ffa (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
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 )
{
}
//-----------------------------------------------------------------------------
|