Fix build & Fix #69

This commit is contained in:
a1batross 2016-01-30 22:24:46 +06:00
parent c109256b1b
commit 488509e1d1
6 changed files with 24 additions and 14 deletions

View File

@ -21,6 +21,7 @@ This file contains "stubs" of class member implementations so that we can predic
add in the functionality you need.
==========================
*/
#include "port.h"
#include "extdll.h"
#include "util.h"
#include "cbase.h"

View File

@ -1394,6 +1394,14 @@ void HUD_WeaponsPostThink( local_state_s *from, local_state_s *to, usercmd_t *cm
case WEAPON_P90:
pWeapon = &g_P90;
break;
case WEAPON_NONE:
break;
case WEAPON_GLOCK:
default:
gEngfuncs.Con_Printf("VALVEWHY: Unknown Weapon %i is active.\n", from->client.m_iId );
break;
}
// Store pointer to our destination entity_state_t so we can get our origin, etc. from it
@ -1451,8 +1459,8 @@ void HUD_WeaponsPostThink( local_state_s *from, local_state_s *to, usercmd_t *cm
player.m_rgAmmo[ pCurrent->m_iSecondaryAmmoType ] = (int)from->client.vuser4[ 2 ];
}
if( g_pWpns[ from->client.m_iId - 1 ] )
g_iWeaponFlags = g_pWpns[ from->client.m_iId - 1 ]->m_iWeaponState;
if( g_pWpns[ from->client.m_iId ] )
g_iWeaponFlags = g_pWpns[ from->client.m_iId ]->m_iWeaponState;
// For random weapon events, use this seed to seed random # generator
player.random_seed = random_seed;
@ -1723,7 +1731,7 @@ void _DLLEXPORT HUD_PostRunCmd( local_state_t *from, local_state_t *to, struct u
#endif
{
to->client.fov = g_lastFOV;
g_iWeaponFlags = from->weapondata[ from->client.m_iId - 1].m_iWeaponState;
g_iWeaponFlags = from->weapondata[ from->client.m_iId ].m_iWeaponState;
g_iPlayerFlags = from->client.flags;
g_iFreezeTimeOver = !(from->client.iuser3 & PLAYER_FREEZE_TIME_OVER);
g_bInBombZone = (from->client.iuser3 & PLAYER_IN_BOMB_ZONE) != 0;

View File

@ -588,9 +588,9 @@ int CHudAmmo::MsgFunc_HideWeapon( const char *pszName, int iSize, void *pbuf )
if (gEngfuncs.IsSpectateOnly())
return 1;
if ( gHUD.m_iHideHUDDisplay & ( HIDEHUD_WEAPONS | HIDEHUD_ALL ) )
if ( gHUD.m_iHideHUDDisplay & ( HIDEHUD_WEAPONS | HIDEHUD_FLASHLIGHT | HIDEHUD_ALL ) )
{
static wrect_t nullrc;
static wrect_t nullrc = {0, 0, 0, 0};
gpActiveSel = NULL;
SetCrosshair( 0, nullrc, 0, 0, 0 );
}
@ -730,7 +730,6 @@ int CHudAmmo::MsgFunc_Crosshair(const char *pszName, int iSize, void *pbuf)
int CHudAmmo::MsgFunc_Brass( const char *pszName, int iSize, void *pbuf )
{
BEGIN_READ( pbuf, iSize );
int MessageID = READ_BYTE();
Vector start, velocity;
@ -1086,13 +1085,15 @@ int CHudAmmo::Draw(float flTime)
if (!m_pWeapon)
return 0;
if( gHUD.m_iFOV > 40 )
DrawCrosshair(flTime, m_pWeapon->iId); // draw a dynamic crosshair
WEAPON *pw = m_pWeapon; // shorthand
// SPR_Draw Ammo
if ((pw->iAmmoType < 0) && (pw->iAmmo2Type < 0))
return 0;
int iFlags = DHN_DRAWZERO; // draw 0 values
AmmoWidth = gHUD.GetSpriteRect(gHUD.m_HUD_number_0).right - gHUD.GetSpriteRect(gHUD.m_HUD_number_0).left;
@ -1176,9 +1177,6 @@ int CHudAmmo::Draw(float flTime)
}
}
if( gHUD.m_iFOV > 40 )
DrawCrosshair(flTime, m_pWeapon->iId); // draw a dynamic crosshair
return 1;
}
@ -1231,6 +1229,10 @@ void CHudAmmo::DrawCrosshair( float flTime, int weaponid )
int iLength;
float flCrosshairDistance;
if ( g_iWeaponFlags & WPNSTATE_SHIELD_DRAWN )
return;
if ( weaponid > 30 )
{
iDistance = 4;

View File

@ -13,6 +13,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
*/
#pragma once
#ifndef PORT_H
#define PORT_H

View File

@ -42,9 +42,6 @@
#define NOIME
#include "windows.h"
#else // _WIN32
#define FALSE 0
#define TRUE (!FALSE)
typedef uint32 ULONG;
typedef unsigned char BYTE;
typedef int BOOL;
#define MAX_PATH PATH_MAX

View File

@ -1,7 +1,8 @@
#ifndef stdafx_h__
#define stdafx_h__
#include "port.h"
#include "extdll.h"
#include "util.h"
#endif // stdafx_h__
#endif // stdafx_h__