mirror of
https://github.com/YGGverse/hlsdk-portable.git
synced 2025-01-12 07:58:05 +00:00
Merge branch 'induction' into mobile_hacks
This commit is contained in:
commit
0100fcf235
@ -111,7 +111,7 @@ int CHudFlashlight::Draw( float flTime )
|
||||
if( gEngfuncs.IsSpectateOnly() )
|
||||
return 1;
|
||||
|
||||
if( !( gHUD.m_iWeaponBits & ( 1 << ( WEAPON_SUIT ) ) ) )
|
||||
if( !( gHUD.m_iWeaponBits & ( 1 << ( WEAPON_FLASHLIGHT ) ) ) )
|
||||
return 1;
|
||||
|
||||
if( m_fOn )
|
||||
|
@ -40,6 +40,6 @@
|
||||
#define HUD_PRINTTALK 3
|
||||
#define HUD_PRINTCENTER 4
|
||||
|
||||
|
||||
#define WEAPON_FLASHLIGHT 30
|
||||
#define WEAPON_SUIT 31
|
||||
#endif
|
||||
|
@ -70,6 +70,9 @@ void CWorldItem::Spawn( void )
|
||||
case 45: // ITEM_SUIT:
|
||||
pEntity = CBaseEntity::Create( "item_suit", pev->origin, pev->angles );
|
||||
break;
|
||||
case 46: // ITEM_FLASHLIGHT:
|
||||
pEntity = CBaseEntity::Create( "item_flashlight", pev->origin, pev->angles );
|
||||
break;
|
||||
}
|
||||
|
||||
if( !pEntity )
|
||||
@ -366,6 +369,33 @@ class CItemSecurity : public CItem
|
||||
|
||||
LINK_ENTITY_TO_CLASS( item_security, CItemSecurity )
|
||||
|
||||
class CItemFlashlight : public CItem
|
||||
{
|
||||
void Spawn( void )
|
||||
{
|
||||
Precache();
|
||||
SET_MODEL( ENT( pev ), "models/w_flashlight.mdl" );
|
||||
CItem::Spawn();
|
||||
}
|
||||
void Precache( void )
|
||||
{
|
||||
PRECACHE_MODEL( "models/w_flashlight.mdl" );
|
||||
PRECACHE_SOUND( "items/gunpickup2.wav" );
|
||||
}
|
||||
BOOL MyTouch( CBasePlayer *pPlayer )
|
||||
{
|
||||
if( pPlayer->pev->weapons & ( 1 << WEAPON_FLASHLIGHT ) )
|
||||
return FALSE;
|
||||
|
||||
EMIT_SOUND( pPlayer->edict(), CHAN_ITEM, "items/gunpickup2.wav", 1, ATTN_NORM );
|
||||
|
||||
pPlayer->pev->weapons |= ( 1 << WEAPON_FLASHLIGHT );
|
||||
return TRUE;
|
||||
}
|
||||
};
|
||||
|
||||
LINK_ENTITY_TO_CLASS( item_flashlight, CItemFlashlight )
|
||||
|
||||
class CItemLongJump : public CItem
|
||||
{
|
||||
void Spawn( void )
|
||||
|
@ -3295,7 +3295,7 @@ void CBasePlayer::FlashlightTurnOn( void )
|
||||
return;
|
||||
}
|
||||
|
||||
if( (pev->weapons & ( 1 << WEAPON_SUIT ) ) )
|
||||
if( (pev->weapons & ( 1 << WEAPON_FLASHLIGHT ) ) )
|
||||
{
|
||||
EMIT_SOUND_DYN( ENT( pev ), CHAN_WEAPON, SOUND_FLASHLIGHT_ON, 1.0, ATTN_NORM, 0, PITCH_NORM );
|
||||
SetBits( pev->effects, EF_DIMLIGHT );
|
||||
|
@ -81,6 +81,7 @@ public:
|
||||
|
||||
#define WEAPON_ALLWEAPONS (~(1<<WEAPON_SUIT))
|
||||
|
||||
#define WEAPON_FLASHLIGHT 30
|
||||
#define WEAPON_SUIT 31 // ?????
|
||||
|
||||
#define MAX_WEAPONS 32
|
||||
|
Loading…
Reference in New Issue
Block a user