summaryrefslogtreecommitdiff
path: root/game/server/hl1/hl1_items.cpp
blob: 3024a27d2d8180a447e8da0c0d9a3c96f3326471 (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
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose: 
//
//=============================================================================//


#include "cbase.h"
#include "player.h"
#include "items.h"
#include "gamerules.h"
#include "hl1_items.h"


void CHL1Item::Spawn( void )
{
	SetMoveType( MOVETYPE_FLYGRAVITY );
	SetSolid( SOLID_BBOX );
	AddSolidFlags( FSOLID_NOT_STANDABLE | FSOLID_TRIGGER );
	CollisionProp()->UseTriggerBounds( true, 24.0f );
	
	SetCollisionGroup( COLLISION_GROUP_DEBRIS );

	SetTouch( &CItem::ItemTouch );

#ifdef HL1_DLL
    if ( g_pGameRules->IsMultiplayer() )
        AddEffects( EF_NOSHADOW );
#endif


}


void CHL1Item::Activate( void )
{
	BaseClass::Activate();

	if ( UTIL_DropToFloor( this, MASK_SOLID ) == 0 )
	{
		Warning( "Item %s fell out of level at %f,%f,%f\n", GetClassname(), GetAbsOrigin().x, GetAbsOrigin().y, GetAbsOrigin().z);
		UTIL_Remove( this );
		return;
	}
}