summaryrefslogtreecommitdiff
path: root/game/shared/tf2/tf_obj_baseupgrade_shared.cpp
blob: 9f0f30fc4a780b94dcb0912c0dd24fddf4e76aa8 (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
58
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose: Base class for object upgrading objects
//
//=============================================================================//
#include "cbase.h"
#include "baseobject_shared.h"
#include "tf_obj_baseupgrade_shared.h"

IMPLEMENT_NETWORKCLASS_ALIASED( BaseObjectUpgrade, DT_BaseObjectUpgrade )

BEGIN_NETWORK_TABLE( CBaseObjectUpgrade, DT_BaseObjectUpgrade )
END_NETWORK_TABLE()

//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
CBaseObjectUpgrade::CBaseObjectUpgrade()
{
#if !defined( CLIENT_DLL )
	UseClientSideAnimation();
#endif
}

//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
void CBaseObjectUpgrade::Spawn()
{
	BaseClass::Spawn();

#if !defined( CLIENT_DLL )
	m_fObjectFlags |= OF_DONT_PREVENT_BUILD_NEAR_OBJ | OF_ALLOW_REPEAT_PLACEMENT | 
					  OF_DOESNT_NEED_POWER | OF_MUST_BE_BUILT_ON_ATTACHMENT; 

	// Prevent anyone shooting / emping / buffing me
	SetSolid( SOLID_NONE );
#endif
}


//-----------------------------------------------------------------------------
// Purpose: Prevent Team Damage
//-----------------------------------------------------------------------------
int CBaseObjectUpgrade::OnTakeDamage( const CTakeDamageInfo &info )
{
#if !defined( CLIENT_DLL )
	// Check teams
	if ( info.GetDamageType() & DMG_BLAST )
	{
		return 0;
	}

	return BaseClass::OnTakeDamage( info );
#else
	return 0;
#endif
}