Browse Source

Do not show hud on vis_credits map.

visitors
Night Owl 7 years ago
parent
commit
38924ed7b1
  1. 8
      cl_dll/battery.cpp
  2. 2
      cl_dll/health.cpp
  3. 3
      dlls/cdll_dll.h
  4. 24
      dlls/player.cpp
  5. 23
      dlls/visitors/kevlar.cpp
  6. 2
      dlls/weapons.h

8
cl_dll/battery.cpp

@ -71,13 +71,7 @@ int CHudBattery::MsgFunc_Battery( const char *pszName, int iSize, void *pbuf )
int CHudBattery::Draw( float flTime ) int CHudBattery::Draw( float flTime )
{ {
if( gHUD.m_iHideHUDDisplay & HIDEHUD_HEALTH ) if( gHUD.m_iHideHUDDisplay & HIDEHUD_SUIT )
return 1;
//
// HL: Visitors - Only draw (kevlar vest) value if non-zero.
//
if( m_iBat <= 0 )
return 1; return 1;
int r, g, b, x, y, a; int r, g, b, x, y, a;

2
cl_dll/health.cpp

@ -212,7 +212,7 @@ int CHudHealth::Draw( float flTime )
ScaleColors( r, g, b, a ); ScaleColors( r, g, b, a );
// Only draw health if we have the suit. // Only draw health if we have the suit.
if( gHUD.m_iWeaponBits & ( 1 << ( WEAPON_SUIT ) ) ) // if( gHUD.m_iWeaponBits & ( 1 << ( WEAPON_SUIT ) ) )
{ {
HealthWidth = gHUD.GetSpriteRect( gHUD.m_HUD_number_0 ).right - gHUD.GetSpriteRect( gHUD.m_HUD_number_0 ).left; HealthWidth = gHUD.GetSpriteRect( gHUD.m_HUD_number_0 ).right - gHUD.GetSpriteRect( gHUD.m_HUD_number_0 ).left;
int CrossWidth = gHUD.GetSpriteRect( m_HUD_cross ).right - gHUD.GetSpriteRect( m_HUD_cross ).left; int CrossWidth = gHUD.GetSpriteRect( m_HUD_cross ).right - gHUD.GetSpriteRect( m_HUD_cross ).left;

3
dlls/cdll_dll.h

@ -31,6 +31,7 @@
#define HIDEHUD_FLASHLIGHT ( 1<<1 ) #define HIDEHUD_FLASHLIGHT ( 1<<1 )
#define HIDEHUD_ALL ( 1<<2 ) #define HIDEHUD_ALL ( 1<<2 )
#define HIDEHUD_HEALTH ( 1<<3 ) #define HIDEHUD_HEALTH ( 1<<3 )
#define HIDEHUD_SUIT ( 1<<4 )
#define MAX_AMMO_TYPES 32 // ??? #define MAX_AMMO_TYPES 32 // ???
#define MAX_AMMO_SLOTS 32 // not really slots #define MAX_AMMO_SLOTS 32 // not really slots
@ -40,7 +41,7 @@
#define HUD_PRINTTALK 3 #define HUD_PRINTTALK 3
#define HUD_PRINTCENTER 4 #define HUD_PRINTCENTER 4
#define WEAPON_FLASHLIGHT 30 #define WEAPON_FLASHLIGHT 18
#define WEAPON_SUIT 31 #define WEAPON_SUIT 31
#endif #endif

24
dlls/player.cpp

@ -1,4 +1,4 @@
/*** Y/***
* *
* Copyright (c) 1996-2002, Valve LLC. All rights reserved. * Copyright (c) 1996-2002, Valve LLC. All rights reserved.
* *
@ -3901,12 +3901,24 @@ void CBasePlayer::UpdateClientData( void )
InitStatusBar(); InitStatusBar();
} }
// if( FStrEq( STRING( gpGlobals->mapname ), "vis01" )
// HL: Visitors - Give suit to toggle hud on map vis07 (Security system failed) || FStrEq( STRING( gpGlobals->mapname ), "vis02" )
// || FStrEq( STRING( gpGlobals->mapname ), "vis03" )
if( !( pev->weapons & ( 1 << WEAPON_SUIT ) ) && FStrEq( STRING( gpGlobals->mapname ), "vis07" ) ) || FStrEq( STRING( gpGlobals->mapname ), "vis04" )
|| FStrEq( STRING( gpGlobals->mapname ), "vis05" )
|| FStrEq( STRING( gpGlobals->mapname ), "vis05a" )
|| FStrEq( STRING( gpGlobals->mapname ), "vis06" )
|| FStrEq( STRING( gpGlobals->mapname ), "vis_credits" ) )
{ {
pev->weapons |= ( 1 << WEAPON_SUIT ); SetBits( m_iHideHUD, HIDEHUD_WEAPONS | HIDEHUD_HEALTH | HIDEHUD_FLASHLIGHT | HIDEHUD_SUIT )
}
else
{
ClearBits( m_iHideHUD, HIDEHUD_WEAPONS | HIDEHUD_HEALTH | HIDEHUD_FLASHLIGHT | HIDEHUD_SUIT )
if( !( pev->weapons & ( 1 << WEAPON_SUIT ) ) || pev->armorvalue == 0 )
{
SetBits( m_iHideHUD, HIDEHUD_SUIT )
}
} }
if( m_iHideHUD != m_iClientHideHUD ) if( m_iHideHUD != m_iClientHideHUD )

23
dlls/visitors/kevlar.cpp

@ -40,25 +40,20 @@ class CItemKevlar : public CItem
BOOL MyTouch(CBasePlayer *pPlayer) BOOL MyTouch(CBasePlayer *pPlayer)
{ {
if (pPlayer->pev->deadflag != DEAD_NO) if (pPlayer->pev->deadflag != DEAD_NO)
{
return FALSE; return FALSE;
}
if ((pPlayer->pev->armorvalue < MAX_NORMAL_BATTERY) && if( !( pPlayer->pev->weapons & ( 1 << WEAPON_SUIT ) ) )
(pPlayer->pev->weapons & (1 << WEAPON_SUIT))) pPlayer->pev->weapons |= ( 1 << WEAPON_SUIT )
{
pPlayer->pev->armorvalue += MAX_NORMAL_BATTERY;
pPlayer->pev->armorvalue = Q_min(pPlayer->pev->armorvalue, MAX_NORMAL_BATTERY);
EMIT_SOUND(pPlayer->edict(), CHAN_ITEM, "player/kevlar_zipper.wav", 1, ATTN_NORM); pPlayer->pev->armorvalue = MAX_NORMAL_BATTERY;
MESSAGE_BEGIN(MSG_ONE, gmsgItemPickup, NULL, pPlayer->pev); EMIT_SOUND_DYN( ENT( m_pPlayer->pev ), CHAN_ITEM, "player/kevlar_zipper.wav", 1, ATTN_NORM, 0, RANDOM_LONG( 100, 150 ) );
WRITE_STRING(STRING(pev->classname));
MESSAGE_END();
return TRUE; MESSAGE_BEGIN( MSG_ONE, gmsgItemPickup, NULL, pPlayer->pev );
} WRITE_STRING( STRING( pev->classname ) );
return FALSE; MESSAGE_END();
return TRUE;
} }
}; };

2
dlls/weapons.h

@ -80,7 +80,7 @@ public:
#define WEAPON_SNARK 15 #define WEAPON_SNARK 15
#define WEAPON_SNIPER 16 #define WEAPON_SNIPER 16
#define WEAPON_PIPE 17 #define WEAPON_PIPE 17
#define WEAPON_FLASHLIGHT 30 #define WEAPON_FLASHLIGHT 18
#define WEAPON_ALLWEAPONS (~(1<<WEAPON_SUIT)) #define WEAPON_ALLWEAPONS (~(1<<WEAPON_SUIT))

Loading…
Cancel
Save