Merge branch 'master' into sohl1.2

This commit is contained in:
Andrey Akhmichin 2021-06-06 18:59:49 +05:00
commit 3fd9768048
29 changed files with 182 additions and 146 deletions

View File

@ -948,13 +948,13 @@ void EV_FireGauss( event_args_t *args )
0.1f,
m_fPrimaryFire ? 1.0f : 2.5f,
0.0f,
m_fPrimaryFire ? 128.0f : flDamage,
(m_fPrimaryFire ? 128.0f : flDamage) / 255.0f,
0,
0,
0,
m_fPrimaryFire ? 255 : 255,
m_fPrimaryFire ? 128 : 255,
m_fPrimaryFire ? 0 : 255
(m_fPrimaryFire ? 255 : 255) / 255.0f,
(m_fPrimaryFire ? 128 : 255) / 255.0f,
(m_fPrimaryFire ? 0 : 255) / 255.0f
);
}
else
@ -965,13 +965,13 @@ void EV_FireGauss( event_args_t *args )
0.1f,
m_fPrimaryFire ? 1.0f : 2.5f,
0.0f,
m_fPrimaryFire ? 128.0f : flDamage,
(m_fPrimaryFire ? 128.0f : flDamage) / 255.0f,
0,
0,
0,
m_fPrimaryFire ? 255 : 255,
m_fPrimaryFire ? 128 : 255,
m_fPrimaryFire ? 0 : 255
(m_fPrimaryFire ? 255 : 255) / 255.0f,
(m_fPrimaryFire ? 128 : 255) / 255.0f,
(m_fPrimaryFire ? 0 : 255) / 255.0f
);
}
@ -1373,7 +1373,7 @@ void EV_FireRpg( event_args_t *args )
//======================
//======================
// EGON END
// EGON START
//======================
enum egon_e
{
@ -1502,10 +1502,11 @@ void EV_EgonFire( event_args_t *args )
float g = 50.0f;
float b = 125.0f;
if( IEngineStudio.IsHardware() )
// if( IEngineStudio.IsHardware() )
{
r /= 100.0f;
g /= 100.0f;
r /= 255.0f;
g /= 255.0f;
b /= 255.0f;
}
pBeam = gEngfuncs.pEfxAPI->R_BeamEntPoint( idx | 0x1000, tr.endpos, iBeamModelIndex, 99999, 3.5, 0.2, 0.7, 55, 0, 0, r, g, b );

View File

@ -332,9 +332,13 @@ void CBasePlayerWeapon::ItemPostFrame( void )
{
if( ( m_fInReload ) && ( m_pPlayer->m_flNextAttack <= 0.0f ) )
{
#if 0 // FIXME, need ammo on client to make this work right
#if 1
// complete the reload.
int j = min( iMaxClip() - m_iClip, m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] );
ItemInfo itemInfo;
memset( &itemInfo, 0, sizeof( itemInfo ) );
GetItemInfo( &itemInfo );
int j = Q_min( itemInfo.iMaxClip - m_iClip, m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] );
// Add them to the clip
m_iClip += j;
@ -375,7 +379,7 @@ void CBasePlayerWeapon::ItemPostFrame( void )
m_fFireOnEmpty = FALSE;
// weapon is useable. Reload if empty and weapon has waited as long as it has to after firing
if( m_iClip == 0 && !( iFlags() & ITEM_FLAG_NOAUTORELOAD ) && m_flNextPrimaryAttack < 0.0f )
if( m_iClip == 0 && !( iFlags() & ITEM_FLAG_NOAUTORELOAD ) && m_flNextPrimaryAttack <= 0.0f )
{
Reload();
return;

View File

@ -824,6 +824,7 @@ bool CHudSpectator::ParseOverviewFile()
char levelname[256] = { 0 };
char token[1024] = { 0 };
float height;
bool ret = false;
char *afile = NULL, *pfile = NULL;
@ -843,7 +844,7 @@ bool CHudSpectator::ParseOverviewFile()
strcpy( m_OverviewData.map, gEngfuncs.pfnGetLevelName() );
if( m_OverviewData.map[0] == '\0' )
return false; // not active yet
return ret; // not active yet
strcpy( levelname, m_OverviewData.map + 5 );
levelname[strlen( levelname ) - 4] = 0;
@ -855,7 +856,7 @@ bool CHudSpectator::ParseOverviewFile()
if( !pfile )
{
gEngfuncs.Con_DPrintf( "Couldn't open file %s. Using default values for overiew mode.\n", filename );
return false;
return ret;
}
while( true )
@ -872,7 +873,7 @@ bool CHudSpectator::ParseOverviewFile()
if( stricmp( token, "{" ) )
{
gEngfuncs.Con_Printf( "Error parsing overview file %s. (expected { )\n", filename );
return false;
goto end;
}
pfile = gEngfuncs.COM_ParseFile( pfile, token );
@ -912,7 +913,7 @@ bool CHudSpectator::ParseOverviewFile()
else
{
gEngfuncs.Con_Printf( "Error parsing overview file %s. (%s unkown)\n", filename, token );
return false;
goto end;
}
pfile = gEngfuncs.COM_ParseFile( pfile, token ); // parse next token
@ -924,7 +925,7 @@ bool CHudSpectator::ParseOverviewFile()
if( m_OverviewData.layers == OVERVIEW_MAX_LAYERS )
{
gEngfuncs.Con_Printf( "Error parsing overview file %s. ( too many layers )\n", filename );
return false;
goto end;
}
pfile = gEngfuncs.COM_ParseFile( pfile, token );
@ -932,7 +933,7 @@ bool CHudSpectator::ParseOverviewFile()
if( stricmp( token, "{" ) )
{
gEngfuncs.Con_Printf( "Error parsing overview file %s. (expected { )\n", filename );
return false;
goto end;
}
pfile = gEngfuncs.COM_ParseFile( pfile, token );
@ -953,7 +954,7 @@ bool CHudSpectator::ParseOverviewFile()
else
{
gEngfuncs.Con_Printf( "Error parsing overview file %s. (%s unkown)\n", filename, token );
return false;
goto end;
}
pfile = gEngfuncs.COM_ParseFile( pfile, token ); // parse next token
@ -963,12 +964,14 @@ bool CHudSpectator::ParseOverviewFile()
}
}
gEngfuncs.COM_FreeFile( afile );
m_mapZoom = m_OverviewData.zoom;
m_mapOrigin = m_OverviewData.origin;
return true;
ret = true;
end:
gEngfuncs.COM_FreeFile( afile );
return ret;
}
void CHudSpectator::LoadMapSprites()

View File

@ -645,11 +645,13 @@ void IN_Impulse( void )
void IN_ScoreDown( void )
{
KeyDown( &in_score );
gHUD.m_Scoreboard.UserCmd_ShowScores();
}
void IN_ScoreUp( void )
{
KeyUp( &in_score );
gHUD.m_Scoreboard.UserCmd_HideScores();
}
void IN_MLookUp( void )
@ -1082,6 +1084,10 @@ void InitInput( void )
gEngfuncs.pfnAddCommand( "-reload", IN_ReloadUp );
gEngfuncs.pfnAddCommand( "+alt1", IN_Alt1Down );
gEngfuncs.pfnAddCommand( "-alt1", IN_Alt1Up );
gEngfuncs.pfnAddCommand( "+score", IN_ScoreDown );
gEngfuncs.pfnAddCommand( "-score", IN_ScoreUp );
gEngfuncs.pfnAddCommand( "+showscores", IN_ScoreDown );
gEngfuncs.pfnAddCommand( "-showscores", IN_ScoreUp );
gEngfuncs.pfnAddCommand( "+graph", IN_GraphDown );
gEngfuncs.pfnAddCommand( "-graph", IN_GraphUp );
gEngfuncs.pfnAddCommand( "+break", IN_BreakDown );

View File

@ -51,8 +51,8 @@ int CHudScoreboard::Init( void )
gHUD.AddHudElem( this );
// Hook messages & commands here
HOOK_COMMAND( "+showscores", ShowScores );
HOOK_COMMAND( "-showscores", HideScores );
// HOOK_COMMAND( "+showscores", ShowScores );
// HOOK_COMMAND( "-showscores", HideScores );
HOOK_MESSAGE( ScoreInfo );
HOOK_MESSAGE( TeamScore );

View File

@ -764,6 +764,10 @@ void V_CalcNormalRefdef( struct ref_params_s *pparams )
if( CL_IsThirdPerson() )
{
VectorCopy( camAngles, pparams->viewangles );
}
// Apply this at all times
{
float pitch = camAngles[0];
// Normalize angles

View File

@ -29,6 +29,7 @@ check_symbol_exists(XASH_MOBILE_PLATFORM "build.h" XASH_MOBILE_PLATFORM)
check_symbol_exists(XASH_MSVC "build.h" XASH_MSVC)
check_symbol_exists(XASH_NETBSD "build.h" XASH_NETBSD)
check_symbol_exists(XASH_OPENBSD "build.h" XASH_OPENBSD)
check_symbol_exists(XASH_HAIKU "build.h" XASH_HAIKU)
check_symbol_exists(XASH_WIN32 "build.h" XASH_WIN32)
check_symbol_exists(XASH_WIN64 "build.h" XASH_WIN64)
check_symbol_exists(XASH_X86 "build.h" XASH_X86)
@ -45,6 +46,8 @@ elseif(XASH_NETBSD)
set(BUILDOS "netbsd")
elseif(XASH_OPENBSD)
set(BUILDOS "openbsd")
elseif(XASH_HAIKU)
set(BUILDOS "haiku")
elseif(XASH_EMSCRIPTEN)
set(BUILDOS "emscripten")
else()
@ -92,7 +95,7 @@ endif()
if(BUILDOS STREQUAL "android")
set(POSTFIX "") # force disable for Android, as Android ports aren't distributed in normal way and doesn't follow library naming
elif(BUILDOS AND BUILDARCH)
elseif(BUILDOS AND BUILDARCH)
set(POSTFIX "_${BUILDOS}_${BUILDARCH}")
elseif(BUILDARCH)
set(POSTFIX "_${BUILDARCH}")

View File

@ -1105,7 +1105,7 @@ Vector VecCheckSplatToss( entvars_t *pev, const Vector &vecSpot1, Vector vecSpot
Vector vecScale;
Vector vecGrenadeVel;
Vector vecTemp;
float flGravity = g_psv_gravity->value;
float flGravity = Q_max( g_psv_gravity->value, 0.1f );
// calculate the midpoint and apex of the 'triangle'
vecMidPoint = vecSpot1 + ( vecSpot2 - vecSpot1 ) * 0.5f;
@ -1121,6 +1121,9 @@ Vector VecCheckSplatToss( entvars_t *pev, const Vector &vecSpot1, Vector vecSpot
// Don't worry about actually hitting the target, this won't hurt us!
// TODO: Need another way to calculate height because current calculation is completely wrong
// and there posible crash.
// How high should the grenade travel (subtract 15 so the grenade doesn't hit the ceiling)?
float height = vecApex.z - vecSpot1.z - 15.0f;
// How fast does the grenade need to travel to reach that height given gravity?

View File

@ -265,6 +265,8 @@ void DispatchSave( edict_t *pent, SAVERESTOREDATA *pSaveData )
{
ENTITYTABLE *pTable = &pSaveData->pTable[pSaveData->currentIndex];
gpGlobals->time = pSaveData->time;
if( pTable->pent != pent )
ALERT( at_error, "ENTITY TABLE OR INDEX IS WRONG!!!!\n" );
@ -319,6 +321,9 @@ int DispatchRestore( edict_t *pent, SAVERESTOREDATA *pSaveData, int globalEntity
Vector oldOffset;
CRestore restoreHelper( pSaveData );
gpGlobals->time = pSaveData->time;
if( globalEntity )
{
CRestore tmpRestore( pSaveData );

View File

@ -304,7 +304,7 @@ public:
virtual BOOL IsAlive( void ) { return (pev->deadflag == DEAD_NO) && pev->health > 0; }
virtual BOOL IsBSPModel( void ) { return pev->solid == SOLID_BSP || pev->movetype == MOVETYPE_PUSHSTEP; }
virtual BOOL ReflectGauss( void ) { return ( IsBSPModel() && !pev->takedamage ); }
virtual BOOL HasTarget( string_t targetname ) { return FStrEq(STRING(targetname), STRING(pev->targetname) ); }
virtual BOOL HasTarget( string_t targetname ) { return FStrEq(STRING(targetname), STRING(pev->target) ); }
virtual BOOL IsInWorld( void );
virtual BOOL IsPlayer( void ) { return FALSE; }
virtual BOOL IsNetClient( void ) { return FALSE; }

View File

@ -35,7 +35,7 @@ cvar_t weaponstay = { "mp_weaponstay","0", FCVAR_SERVER };
cvar_t selfgauss = { "selfgauss", "1", FCVAR_SERVER };
cvar_t chargerfix = { "chargerfix", "0", FCVAR_SERVER };
cvar_t satchelfix = { "satchelfix", "0", FCVAR_SERVER };
cvar_t monsteryawspeedfix = { "monsteryawspeedfix", "0", FCVAR_SERVER };
cvar_t monsteryawspeedfix = { "monsteryawspeedfix", "1", FCVAR_SERVER };
cvar_t forcerespawn = { "mp_forcerespawn","1", FCVAR_SERVER };
cvar_t flashlight = { "mp_flashlight","0", FCVAR_SERVER };
cvar_t aimcrosshair = { "mp_autocrosshair","1", FCVAR_SERVER };

View File

@ -124,12 +124,6 @@ int CGauss::GetItemInfo( ItemInfo *p )
return 1;
}
BOOL CGauss::IsUseable()
{
// Currently charging, allow the player to fire it first. - Solokiller
return CBasePlayerWeapon::IsUseable() || m_fInAttack != 0;
}
BOOL CGauss::Deploy()
{
m_pPlayer->m_flPlayAftershock = 0.0;
@ -231,22 +225,6 @@ void CGauss::SecondaryAttack()
}
else
{
// Moved to before the ammo burn.
// Because we drained 1 when m_InAttack == 0, then 1 again now before checking if we're out of ammo,
// this resuled in the player having -1 ammo, which in turn caused CanDeploy to think it could be deployed.
// This will need to be fixed further down the line by preventing negative ammo unless explicitly required (infinite ammo?),
// But this check will prevent the problem for now. - Solokiller
// TODO: investigate further.
if( m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] <= 0 )
{
// out of ammo! force the gun to fire
StartFire();
m_fInAttack = 0;
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 1.0f;
m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 1;
return;
}
// during the charging process, eat one bit of ammo every once in a while
if( UTIL_WeaponTimeBase() >= m_pPlayer->m_flNextAmmoBurn && m_pPlayer->m_flNextAmmoBurn != 1000 )
{
@ -266,6 +244,16 @@ void CGauss::SecondaryAttack()
}
}
if( m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] <= 0 )
{
// out of ammo! force the gun to fire
StartFire();
m_fInAttack = 0;
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 1.0f;
m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 1;
return;
}
if( UTIL_WeaponTimeBase() >= m_pPlayer->m_flAmmoStartCharge )
{
// don't eat any more ammo after gun is fully charged.
@ -583,10 +571,6 @@ void CGauss::WeaponIdle( void )
StartFire();
m_fInAttack = 0;
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 2.0f;
// Need to set m_flNextPrimaryAttack so the weapon gets a chance to complete its secondary fire animation. - Solokiller
if( m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] <= 0 )
m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.5f;
}
else
{

View File

@ -522,6 +522,7 @@ void CHoundeye::WriteBeamColor( void )
bBlue = 255;
break;
case 4:
case 5:
bRed = 62;
bGreen = 33;
bBlue = 211;

View File

@ -66,7 +66,7 @@ void CBaseMonster::RunAI( void )
// IDLE sound permitted in ALERT state is because monsters were silent in ALERT state. Only play IDLE sound in IDLE state
// once we have sounds for that state.
if( ( m_MonsterState == MONSTERSTATE_IDLE || m_MonsterState == MONSTERSTATE_ALERT ) && RANDOM_LONG( 0, 99 ) == 0 && !( pev->flags & SF_MONSTER_GAG ) )
if( ( m_MonsterState == MONSTERSTATE_IDLE || m_MonsterState == MONSTERSTATE_ALERT ) && RANDOM_LONG( 0, 99 ) == 0 && !( pev->spawnflags & SF_MONSTER_GAG ) )
{
IdleSound();
}

View File

@ -270,12 +270,6 @@ void CMP5::WeaponIdle( void )
m_flTimeWeaponIdle = UTIL_SharedRandomFloat( m_pPlayer->random_seed, 10, 15 ); // how long till we do this again.
}
BOOL CMP5::IsUseable()
{
//Can be used if the player has AR grenades. - Solokiller
return CBasePlayerWeapon::IsUseable() || m_pPlayer->m_rgAmmo[m_iSecondaryAmmoType] > 0;
}
class CMP5AmmoClip : public CBasePlayerAmmo
{
void Spawn( void )

View File

@ -710,12 +710,12 @@ void CHalfLifeMultiplay::DeathNotice( CBasePlayer *pVictim, entvars_t *pKiller,
const char *tau = "tau_cannon";
const char *gluon = "gluon gun";
if( pKiller->flags & FL_CLIENT )
if( pevInflictor )
{
killer_index = ENTINDEX( ENT( pKiller ) );
if( pevInflictor )
if( pKiller->flags & FL_CLIENT )
{
killer_index = ENTINDEX( ENT( pKiller ) );
if( pevInflictor == pKiller )
{
// If the inflictor is the killer, then it must be their current weapon doing the damage
@ -731,10 +731,10 @@ void CHalfLifeMultiplay::DeathNotice( CBasePlayer *pVictim, entvars_t *pKiller,
killer_weapon_name = STRING( pevInflictor->classname ); // it's just that easy
}
}
}
else
{
killer_weapon_name = STRING( pevInflictor->classname );
else
{
killer_weapon_name = STRING( pevInflictor->classname );
}
}
// strip the monster_* or weapon_* from the inflictor's classname

View File

@ -1363,23 +1363,26 @@ void CBasePlayer::WaterMove()
}
// make bubbles
air = (int)( pev->air_finished - gpGlobals->time );
if( !RANDOM_LONG( 0, 0x1f ) && RANDOM_LONG( 0, AIRTIME - 1 ) >= air )
if( pev->waterlevel == 3 )
{
switch( RANDOM_LONG( 0, 3 ) )
air = (int)( pev->air_finished - gpGlobals->time );
if( !RANDOM_LONG( 0, 0x1f ) && RANDOM_LONG( 0, AIRTIME - 1 ) >= air )
{
case 0:
EMIT_SOUND( ENT( pev ), CHAN_BODY, "player/pl_swim1.wav", 0.8, ATTN_NORM );
break;
case 1:
EMIT_SOUND( ENT( pev ), CHAN_BODY, "player/pl_swim2.wav", 0.8, ATTN_NORM );
break;
case 2:
EMIT_SOUND( ENT( pev ), CHAN_BODY, "player/pl_swim3.wav", 0.8, ATTN_NORM );
break;
case 3:
EMIT_SOUND( ENT( pev ), CHAN_BODY, "player/pl_swim4.wav", 0.8, ATTN_NORM );
break;
switch( RANDOM_LONG( 0, 3 ) )
{
case 0:
EMIT_SOUND( ENT( pev ), CHAN_BODY, "player/pl_swim1.wav", 0.8, ATTN_NORM );
break;
case 1:
EMIT_SOUND( ENT( pev ), CHAN_BODY, "player/pl_swim2.wav", 0.8, ATTN_NORM );
break;
case 2:
EMIT_SOUND( ENT( pev ), CHAN_BODY, "player/pl_swim3.wav", 0.8, ATTN_NORM );
break;
case 3:
EMIT_SOUND( ENT( pev ), CHAN_BODY, "player/pl_swim4.wav", 0.8, ATTN_NORM );
break;
}
}
}

View File

@ -781,6 +781,9 @@ int CScientist::ISoundMask( void )
{
return bits_SOUND_WORLD |
bits_SOUND_COMBAT |
bits_SOUND_CARCASS |
bits_SOUND_MEAT |
bits_SOUND_GARBAGE |
bits_SOUND_DANGER |
bits_SOUND_PLAYER;
}

View File

@ -302,7 +302,7 @@ void CShotgun::Reload( void )
}
}
void CShotgun::WeaponTick()
void CShotgun::ItemPostFrame( void )
{
if( m_flPumpTime && m_flPumpTime < gpGlobals->time )
{
@ -310,6 +310,8 @@ void CShotgun::WeaponTick()
EMIT_SOUND_DYN( ENT( m_pPlayer->pev ), CHAN_ITEM, "weapons/scock1.wav", 1, ATTN_NORM, 0, 95 + RANDOM_LONG( 0, 0x1f ) );
m_flPumpTime = 0;
}
CBasePlayerWeapon::ItemPostFrame();
}
void CShotgun::WeaponIdle( void )

View File

@ -167,7 +167,7 @@ void CSquadMonster::SquadRemove( CSquadMonster *pRemove )
{
for( int i = 0; i < MAX_SQUAD_MEMBERS - 1; i++ )
{
if( pSquadLeader->m_hSquadMember[i] == this )
if( pSquadLeader->m_hSquadMember[i] == pRemove )
{
pSquadLeader->m_hSquadMember[i] = NULL;
break;
@ -256,7 +256,10 @@ void CSquadMonster::SquadMakeEnemy( CBaseEntity *pEnemy )
if( pMember )
{
// reset members who aren't activly engaged in fighting
if( pMember->m_hEnemy != pEnemy && !pMember->HasConditions( bits_COND_SEE_ENEMY ) )
if( pMember->m_hEnemy != pEnemy && !pMember->HasConditions( bits_COND_SEE_ENEMY )
&& ( pMember->m_pSchedule && (pMember->m_pSchedule->iInterruptMask & bits_COND_NEW_ENEMY) )
// My enemy might be not an enemy for member of my squad, e.g. if I was provoked by player.
&& pMember->IRelationship(pEnemy) >= R_DL )
{
if( pMember->m_hEnemy != 0 )
{

View File

@ -5262,8 +5262,8 @@ void CTriggerCamera::FollowTarget()
if( dy > 180 )
dy = dy - 360;
pev->avelocity.x = dx * 40 * gpGlobals->frametime;
pev->avelocity.y = dy * 40 * gpGlobals->frametime;
pev->avelocity.x = dx * 40 * 0.01f;
pev->avelocity.y = dy * 40 * 0.01f;
if( !( FBitSet( pev->spawnflags, SF_CAMERA_PLAYER_TAKECONTROL ) ) )
{

View File

@ -1170,6 +1170,9 @@ void CSentry::Precache()
PRECACHE_MODEL(STRING(pev->model)); //LRC
else
PRECACHE_MODEL( "models/sentry.mdl" );
PRECACHE_SOUND( "weapons/hks1.wav" );
PRECACHE_SOUND( "weapons/hks2.wav" );
PRECACHE_SOUND( "weapons/hks3.wav" );
}
void CSentry::Spawn()

View File

@ -594,14 +594,12 @@ BOOL CanAttack( float attack_time, float curtime, BOOL isPredicted )
}
else
{
return ( attack_time <= 0.0f ) ? TRUE : FALSE;
return ( (static_cast<int>(::floor(attack_time * 1000.0f)) * 1000.0f) <= 0.0f) ? TRUE : FALSE;
}
}
void CBasePlayerWeapon::ItemPostFrame( void )
{
WeaponTick();
if( ( m_fInReload ) && ( m_pPlayer->m_flNextAttack <= UTIL_WeaponTimeBase() ) )
{
// complete the reload.
@ -905,16 +903,38 @@ BOOL CBasePlayerWeapon::AddSecondaryAmmo( int iCount, char *szName, int iMax )
//=========================================================
BOOL CBasePlayerWeapon::IsUseable( void )
{
if( m_iClip <= 0 )
if( m_iClip > 0 )
{
if( m_pPlayer->m_rgAmmo[PrimaryAmmoIndex()] <= 0 && iMaxAmmo1() != -1 )
return TRUE;
}
// Player has unlimited ammo for this weapon or does not use magazines
if( iMaxAmmo1() == WEAPON_NOCLIP )
{
return TRUE;
}
if( m_pPlayer->m_rgAmmo[PrimaryAmmoIndex()] > 0 )
{
return TRUE;
}
if( pszAmmo2() )
{
// Player has unlimited ammo for this weapon or does not use magazines
if( iMaxAmmo2() == WEAPON_NOCLIP )
{
// clip is empty (or nonexistant) and the player has no more ammo of this type.
return FALSE;
return TRUE;
}
if( m_pPlayer->m_rgAmmo[SecondaryAmmoIndex()] > 0 )
{
return TRUE;
}
}
return TRUE;
// clip is empty (or nonexistant) and the player has no more ammo of this type.
return FALSE;
}
BOOL CBasePlayerWeapon::CanDeploy( void )
@ -1105,13 +1125,13 @@ int CBasePlayerWeapon::ExtractAmmo( CBasePlayerWeapon *pWeapon )
{
// blindly call with m_iDefaultAmmo. It's either going to be a value or zero. If it is zero,
// we only get the ammo in the weapon's clip, which is what we want.
iReturn = pWeapon->AddPrimaryAmmo( m_iDefaultAmmo, (char *)pszAmmo1(), iMaxClip(), iMaxAmmo1() );
iReturn |= pWeapon->AddPrimaryAmmo( m_iDefaultAmmo, (char *)pszAmmo1(), iMaxClip(), iMaxAmmo1() );
m_iDefaultAmmo = 0;
}
if( pszAmmo2() != NULL )
{
iReturn = pWeapon->AddSecondaryAmmo( 0, (char *)pszAmmo2(), iMaxAmmo2() );
iReturn |= pWeapon->AddSecondaryAmmo( 0, (char *)pszAmmo2(), iMaxAmmo2() );
}
return iReturn;

View File

@ -321,7 +321,6 @@ public:
virtual void PrimaryAttack( void ) { return; } // do "+ATTACK"
virtual void SecondaryAttack( void ) { return; } // do "+ATTACK2"
virtual void Reload( void ) { return; } // do "+RELOAD"
virtual void WeaponTick() {} // Always called at beginning of ItemPostFrame. - Solokiller
virtual void WeaponIdle( void ) { return; } // called when no buttons pressed
virtual int UpdateClientData( CBasePlayer *pPlayer ); // sends hud info to client dll, if things have changed
virtual void RetireWeapon( void );
@ -574,7 +573,6 @@ public:
BOOL Deploy( void );
void Reload( void );
void WeaponIdle( void );
BOOL IsUseable();
float m_flNextAnimTime;
int m_iShell;
@ -644,8 +642,8 @@ public:
void SecondaryAttack( void );
BOOL Deploy( );
void Reload( void );
void WeaponTick();
void WeaponIdle( void );
void ItemPostFrame( void );
int m_fInReload;
float m_flNextReload;
int m_iShell;
@ -753,7 +751,7 @@ public:
int iItemSlot( void ) { return 4; }
int GetItemInfo(ItemInfo *p);
int AddToPlayer( CBasePlayer *pPlayer );
BOOL IsUseable();
BOOL Deploy( void );
void Holster( int skiplocal = 0 );

View File

@ -63,19 +63,7 @@ playermove_t *pmove = NULL;
#define STOP_EPSILON 0.1f
#define CTEXTURESMAX 512 // max number of textures loaded
#define CBTEXTURENAMEMAX 13 // only load first n chars of name
#define CHAR_TEX_CONCRETE 'C' // texture types
#define CHAR_TEX_METAL 'M'
#define CHAR_TEX_DIRT 'D'
#define CHAR_TEX_VENT 'V'
#define CHAR_TEX_GRATE 'G'
#define CHAR_TEX_TILE 'T'
#define CHAR_TEX_SLOSH 'S'
#define CHAR_TEX_WOOD 'W'
#define CHAR_TEX_COMPUTER 'P'
#define CHAR_TEX_GLASS 'Y'
#define CHAR_TEX_FLESH 'F'
#include "pm_materials.h"
#define STEP_CONCRETE 0 // default step sound
#define STEP_METAL 1 // metal floor

View File

@ -67,6 +67,7 @@ For more information, please refer to <http://unlicense.org/>
#undef XASH_MSVC
#undef XASH_NETBSD
#undef XASH_OPENBSD
#undef XASH_HAIKU
#undef XASH_WIN32
#undef XASH_WIN64
#undef XASH_X86
@ -115,6 +116,9 @@ For more information, please refer to <http://unlicense.org/>
#elif defined __WATCOMC__ && defined __DOS__
#define XASH_DOS4GW 1
#define XASH_LITTLE_ENDIAN
#elif defined __HAIKU__
#define XASH_HAIKU 1
#define XASH_POSIX 1
#else
#error "Place your operating system name here! If this is a mistake, try to fix conditions above and report a bug"
#endif

View File

@ -47,6 +47,7 @@ DEFINES = [
'XASH_MSVC',
'XASH_NETBSD',
'XASH_OPENBSD',
'XASH_HAIKU',
'XASH_WIN32',
'XASH_WIN64',
'XASH_X86',
@ -79,6 +80,8 @@ def configure(conf):
buildos = "emscripten"
elif conf.env.XASH_DOS4GW:
buildos = "dos4gw" # unused, just in case
elif conf.env.XASH_HAIKU:
buildos = "haiku"
else:
conf.fatal("Place your operating system name in build.h and library_naming.py!\n"
"If this is a mistake, try to fix conditions above and report a bug")

12
waf vendored

File diff suppressed because one or more lines are too long

43
wscript
View File

@ -46,13 +46,14 @@ def options(opt):
grp.add_option('--enable-simple-mod-hacks', action = 'store_true', dest = 'ENABLE_MOD_HACKS', default = False,
help = 'enable hacks for simple mods that mostly compatible with Half-Life but has little changes. Enforced for Android. [default: %default]')
opt.load('xcompile compiler_cxx compiler_c clang_compilation_database strip_on_install')
opt.load('subproject')
opt.add_subproject(['cl_dll', 'dlls'])
opt.load('xcompile compiler_cxx compiler_c clang_compilation_database strip_on_install msdev msvs')
if sys.platform == 'win32':
opt.load('msvc msdev msvs')
opt.load('reconfigure subproject')
opt.add_subproject(["cl_dll", "dlls"])
opt.load('msvc')
opt.load('reconfigure')
def configure(conf):
# Configuration
@ -62,7 +63,7 @@ def configure(conf):
conf.env.SERVER_NAME = 'hl'
conf.env.PREFIX = ''
conf.load('fwgslib reconfigure')
conf.load('fwgslib reconfigure enforce_pic')
enforce_pic = True # modern defaults
valid_build_types = ['fastnative', 'fast', 'release', 'debug', 'nooptimize', 'sanitize', 'none']
@ -87,10 +88,19 @@ def configure(conf):
# subsystem=bld.env.MSVC_SUBSYSTEM
# TODO: wrapper around bld.stlib, bld.shlib and so on?
conf.env.MSVC_SUBSYSTEM = 'WINDOWS,5.01'
conf.env.MSVC_TARGETS = ['x86'] # explicitly request x86 target for MSVC
if sys.platform == 'win32':
conf.load('msvc msdev')
conf.load('xcompile compiler_c compiler_cxx strip_on_install')
conf.env.MSVC_TARGETS = ['x86' if not conf.options.ALLOW64 else 'x64']
# Load compilers early
conf.load('xcompile compiler_c compiler_cxx')
# HACKHACK: override msvc DEST_CPU value by something that we understand
if conf.env.DEST_CPU == 'amd64':
conf.env.DEST_CPU = 'x86_64'
if conf.env.COMPILER_CC == 'msvc':
conf.load('msvc_pdb')
conf.load('msvs msdev strip_on_install')
try:
conf.env.CC_VERSION[0]
@ -104,17 +114,8 @@ def configure(conf):
conf.env.MAGX = conf.options.MAGX
if conf.options.MAGX:
enforce_pic = False
if enforce_pic:
# Every static library must have fPIC
if conf.env.DEST_OS != 'win32' and '-fPIC' in conf.env.CFLAGS_cshlib:
conf.env.append_unique('CFLAGS_cstlib', '-fPIC')
conf.env.append_unique('CXXFLAGS_cxxstlib', '-fPIC')
else:
conf.env.CFLAGS_cshlib.remove('-fPIC')
conf.env.CXXFLAGS_cxxshlib.remove('-fPIC')
conf.env.CFLAGS_MACBUNDLE.remove('-fPIC')
conf.env.CXXFLAGS_MACBUNDLE.remove('-fPIC')
conf.check_pic(enforce_pic)
# We restrict 64-bit builds ONLY for Win/Linux/OSX running on Intel architecture
# Because compatibility with original GoldSrc