Browse Source

Merge branch 'bugfixes' into theyhunger

theyhunger
Night Owl 7 years ago
parent
commit
3c403c0a7b
  1. 3
      cl_dll/health.cpp
  2. 2
      cl_dll/hl/hl_weapons.cpp
  3. 3
      cl_dll/hud.cpp
  4. 2
      cl_dll/hud.h
  5. 15
      cl_dll/hud_msg.cpp
  6. 2
      cl_dll/input_goldsource.cpp
  7. 2
      cl_dll/scoreboard.cpp
  8. 3
      dlls/monsters.cpp
  9. 18
      dlls/player.cpp

3
cl_dll/health.cpp

@ -240,7 +240,8 @@ int CHudHealth::Draw( float flTime ) @@ -240,7 +240,8 @@ int CHudHealth::Draw( float flTime )
int iHeight = gHUD.m_iFontHeight;
int iWidth = HealthWidth / 10;
FillRGBA( x, y, iWidth, iHeight, 255, 160, 0, a );
UnpackRGB( r, g, b, RGB_YELLOWISH );
FillRGBA( x, y, iWidth, iHeight, r, g, b, a );
}
}

2
cl_dll/hl/hl_weapons.cpp

@ -34,6 +34,7 @@ @@ -34,6 +34,7 @@
extern globalvars_t *gpGlobals;
extern int g_iUser1;
extern bool g_hasPredictedFOV; // Vit_amiN: from HUD
// Pool of client side entities/entvars_t
static entvars_t ev[32];
@ -820,6 +821,7 @@ void HUD_WeaponsPostThink( local_state_s *from, local_state_s *to, usercmd_t *cm @@ -820,6 +821,7 @@ void HUD_WeaponsPostThink( local_state_s *from, local_state_s *to, usercmd_t *cm
to->client.fuser2 = player.m_flNextAmmoBurn;
to->client.fuser3 = player.m_flAmmoStartCharge;
to->client.maxspeed = player.pev->maxspeed;
g_hasPredictedFOV = true; // Vit_amiN: ready
// Make sure that weapon animation matches what the game .dll is telling us
// over the wire ( fixes some animation glitches )

3
cl_dll/hud.cpp

@ -413,6 +413,7 @@ int CHud::MsgFunc_Logo( const char *pszName, int iSize, void *pbuf ) @@ -413,6 +413,7 @@ int CHud::MsgFunc_Logo( const char *pszName, int iSize, void *pbuf )
}
float g_lastFOV = 0.0;
bool g_hasPredictedFOV = false; // Vit_amiN: it'll became true after the first prediction
/*
============
@ -515,7 +516,7 @@ int CHud::MsgFunc_SetFOV( const char *pszName, int iSize, void *pbuf ) @@ -515,7 +516,7 @@ int CHud::MsgFunc_SetFOV( const char *pszName, int iSize, void *pbuf )
#ifdef CLIENT_WEAPONS
//Weapon prediction already takes care of changing the fog. ( g_lastFOV ).
if( cl_lw && cl_lw->value )
if( g_hasPredictedFOV )
return 1;
#endif
g_lastFOV = newfov;

2
cl_dll/hud.h

@ -230,7 +230,7 @@ public: @@ -230,7 +230,7 @@ public:
void InitHUDData( void );
int VidInit( void );
int Draw( float flTime );
int DrawPlayers( int xoffset, float listslot, int nameoffset = 0, char *team = NULL ); // returns the ypos where it finishes drawing
int DrawPlayers( int xoffset, float listslot, int nameoffset = 0, const char *team = NULL ); // returns the ypos where it finishes drawing
void UserCmd_ShowScores( void );
void UserCmd_HideScores( void );
int MsgFunc_ScoreInfo( const char *pszName, int iSize, void *pbuf );

15
cl_dll/hud_msg.cpp

@ -23,6 +23,9 @@ @@ -23,6 +23,9 @@
#define MAX_CLIENTS 32
extern float g_lastFOV; // Vit_amiN
extern bool g_hasPredictedFOV; // Vit_amiN
/// USER-DEFINED SERVER MESSAGE HANDLERS
int CHud::MsgFunc_ResetHUD( const char *pszName, int iSize, void *pbuf )
@ -45,6 +48,11 @@ int CHud::MsgFunc_ResetHUD( const char *pszName, int iSize, void *pbuf ) @@ -45,6 +48,11 @@ int CHud::MsgFunc_ResetHUD( const char *pszName, int iSize, void *pbuf )
// reset concussion effect
m_iConcussionEffect = 0;
// Vit_amiN: reset the FOV
m_iFOV = 0; // default_fov
g_lastFOV = 0.0f;
g_hasPredictedFOV = false;
return 1;
}
@ -66,7 +74,6 @@ void CHud::MsgFunc_InitHUD( const char *pszName, int iSize, void *pbuf ) @@ -66,7 +74,6 @@ void CHud::MsgFunc_InitHUD( const char *pszName, int iSize, void *pbuf )
pList->p->InitHUDData();
pList = pList->pNext;
}
}
int CHud::MsgFunc_GameMode( const char *pszName, int iSize, void *pbuf )
@ -102,10 +109,14 @@ int CHud::MsgFunc_Damage( const char *pszName, int iSize, void *pbuf ) @@ -102,10 +109,14 @@ int CHud::MsgFunc_Damage( const char *pszName, int iSize, void *pbuf )
int CHud::MsgFunc_Concuss( const char *pszName, int iSize, void *pbuf )
{
int r, g, b;
BEGIN_READ( pbuf, iSize );
m_iConcussionEffect = READ_BYTE();
if( m_iConcussionEffect )
this->m_StatusIcons.EnableIcon( "dmg_concuss", 255, 160, 0 );
{
UnpackRGB( r, g, b, RGB_YELLOWISH ); // Vit_amiN: fixed
this->m_StatusIcons.EnableIcon( "dmg_concuss", r, g, b );
}
else
this->m_StatusIcons.DisableIcon( "dmg_concuss" );
return 1;

2
cl_dll/input_goldsource.cpp

@ -1368,7 +1368,7 @@ void IN_JoyMove ( float frametime, usercmd_t *cmd ) @@ -1368,7 +1368,7 @@ void IN_JoyMove ( float frametime, usercmd_t *cmd )
// y=ax^b; where a = 300 and b = 1.3
// also x values are in increments of 800 (so this is factored out)
// then bounds check result to level out excessively high spin rates
fTemp = 300.0 * pow(abs(fAxisValue) / 800.0, 1.3);
fTemp = 300.0 * pow(fabs(fAxisValue) / 800.0, 1.3);
if (fTemp > 14000.0)
fTemp = 14000.0;
// restore direction information

2
cl_dll/scoreboard.cpp

@ -337,7 +337,7 @@ int CHudScoreboard::Draw( float fTime ) @@ -337,7 +337,7 @@ int CHudScoreboard::Draw( float fTime )
extern float *GetClientColor( int client );
// returns the ypos where it finishes drawing
int CHudScoreboard::DrawPlayers( int xpos_rel, float list_slot, int nameoffset, char *team )
int CHudScoreboard::DrawPlayers( int xpos_rel, float list_slot, int nameoffset, const char *team )
{
int can_show_packetloss = 0;
int FAR_RIGHT;

3
dlls/monsters.cpp

@ -2118,7 +2118,8 @@ void CBaseMonster::StartMonster( void ) @@ -2118,7 +2118,8 @@ void CBaseMonster::StartMonster( void )
SetThink( &CBaseMonster::CallMonsterThink );
pev->nextthink += RANDOM_FLOAT( 0.1, 0.4 ); // spread think times.
if( !FStringNull( pev->targetname ) )// wait until triggered
// Vit_amiN: fixed -- now it doesn't touch any scripted_sequence target
if( !FStringNull( pev->targetname ) && !m_pCine )// wait until triggered
{
SetState( MONSTERSTATE_IDLE );
// UNDONE: Some scripted sequence monsters don't have an idle?

18
dlls/player.cpp

@ -1872,6 +1872,7 @@ void CBasePlayer::PreThink( void ) @@ -1872,6 +1872,7 @@ void CBasePlayer::PreThink( void )
{
CBaseEntity *pTrain = CBaseEntity::Instance( pev->groundentity );
float vel;
int iGearId; // Vit_amiN: keeps the train control HUD in sync
if( !pTrain )
{
@ -1912,10 +1913,12 @@ void CBasePlayer::PreThink( void ) @@ -1912,10 +1913,12 @@ void CBasePlayer::PreThink( void )
pTrain->Use( this, this, USE_SET, (float)vel );
}
if( vel )
iGearId = TrainSpeed( pTrain->pev->speed, pTrain->pev->impulse );
if( iGearId != ( m_iTrain & 0x0F ) ) // Vit_amiN: speed changed
{
m_iTrain = TrainSpeed( (int)pTrain->pev->speed, pTrain->pev->impulse );
m_iTrain |= TRAIN_ACTIVE|TRAIN_NEW;
m_iTrain = iGearId;
m_iTrain |= TRAIN_ACTIVE | TRAIN_NEW;
}
}
else if( m_iTrain & TRAIN_ACTIVE )
@ -2938,6 +2941,8 @@ void CBasePlayer::Precache( void ) @@ -2938,6 +2941,8 @@ void CBasePlayer::Precache( void )
if( gInitHUD )
m_fInitHUD = TRUE;
pev->fov = m_iFOV; // Vit_amiN: restore the FOV on level change or map/saved game load
}
int CBasePlayer::Save( CSave &save )
@ -3359,6 +3364,8 @@ void CBasePlayer::ForceClientDllUpdate( void ) @@ -3359,6 +3364,8 @@ void CBasePlayer::ForceClientDllUpdate( void )
{
m_iClientHealth = -1;
m_iClientBattery = -1;
m_iClientHideHUD = -1; // Vit_amiN: forcing to update
m_iClientFOV = -1; // Vit_amiN: force client weapons to be sent
m_iTrain |= TRAIN_NEW; // Force new train message.
m_fWeapon = FALSE; // Force weapon send
m_fKnownItem = FALSE; // Force weaponinit messages.
@ -3932,6 +3939,11 @@ void CBasePlayer::UpdateClientData( void ) @@ -3932,6 +3939,11 @@ void CBasePlayer::UpdateClientData( void )
WRITE_BYTE( m_iFlashBattery );
MESSAGE_END();
// Vit_amiN: the geiger state could run out of sync, too
MESSAGE_BEGIN( MSG_ONE, gmsgGeigerRange, NULL, pev );
WRITE_BYTE( 0 );
MESSAGE_END();
InitStatusBar();
}

Loading…
Cancel
Save