Merge branch 'maplab-fixes' of https://github.com/1upD/source-sdk-2013 into dev

This commit is contained in:
Derek Dik 2018-11-01 14:53:46 -04:00
commit ec29683e10
5 changed files with 26 additions and 28 deletions

View File

@ -1471,25 +1471,6 @@ void CDetailObjectSystem::LevelInitPreEntity()
}
}
if ( m_DetailObjects.Count() || m_DetailSpriteDict.Count() )
{
// There are detail objects in the level, so precache the material
PrecacheMaterial( DETAIL_SPRITE_MATERIAL );
IMaterial *pMat = m_DetailSpriteMaterial;
// adjust for non-square textures (cropped)
float flRatio = (float)( pMat->GetMappingWidth() ) / pMat->GetMappingHeight();
if ( flRatio > 1.0 )
{
for( int i = 0; i<m_DetailSpriteDict.Count(); i++ )
{
m_DetailSpriteDict[i].m_TexUL.y *= flRatio;
m_DetailSpriteDict[i].m_TexLR.y *= flRatio;
m_DetailSpriteDictFlipped[i].m_TexUL.y *= flRatio;
m_DetailSpriteDictFlipped[i].m_TexLR.y *= flRatio;
}
}
}
int detailPropLightingLump;
if( g_pMaterialSystemHardwareConfig->GetHDRType() != HDR_TYPE_NONE )
{
@ -1512,13 +1493,30 @@ void CDetailObjectSystem::LevelInitPreEntity()
void CDetailObjectSystem::LevelInitPostEntity()
{
const char *pDetailSpriteMaterial = DETAIL_SPRITE_MATERIAL;
C_World *pWorld = GetClientWorldEntity();
if ( pWorld && pWorld->GetDetailSpriteMaterial() && *(pWorld->GetDetailSpriteMaterial()) )
if ( m_DetailObjects.Count() || m_DetailSpriteDict.Count() )
{
pDetailSpriteMaterial = pWorld->GetDetailSpriteMaterial();
const char *pDetailSpriteMaterial = DETAIL_SPRITE_MATERIAL;
C_World *pWorld = GetClientWorldEntity();
if ( pWorld && pWorld->GetDetailSpriteMaterial() && *(pWorld->GetDetailSpriteMaterial()) )
pDetailSpriteMaterial = pWorld->GetDetailSpriteMaterial();
m_DetailSpriteMaterial.Init( pDetailSpriteMaterial, TEXTURE_GROUP_OTHER );
PrecacheMaterial( pDetailSpriteMaterial );
IMaterial *pMat = m_DetailSpriteMaterial;
// adjust for non-square textures (cropped)
float flRatio = pMat->GetMappingWidth() / pMat->GetMappingHeight();
if ( flRatio > 1.0 )
{
for( int i = 0; i<m_DetailSpriteDict.Count(); i++ )
{
m_DetailSpriteDict[i].m_TexUL.y *= flRatio;
m_DetailSpriteDict[i].m_TexLR.y *= flRatio;
m_DetailSpriteDictFlipped[i].m_TexUL.y *= flRatio;
m_DetailSpriteDictFlipped[i].m_TexLR.y *= flRatio;
}
}
}
m_DetailSpriteMaterial.Init( pDetailSpriteMaterial, TEXTURE_GROUP_OTHER );
if ( GetDetailController() )
{

View File

@ -2565,7 +2565,7 @@ void CNPC_Combine::SpeakSentence( int sentenceType )
//=========================================================
// PainSound
//=========================================================
void CNPC_Combine::PainSound ( void )
void CNPC_Combine::PainSound ( const CTakeDamageInfo &info )
{
// NOTE: The response system deals with this at the moment
if ( GetFlags() & FL_DISSOLVING )

View File

@ -126,7 +126,7 @@ public:
// Sounds
// -------------
void DeathSound( void );
void PainSound( void );
void PainSound( const CTakeDamageInfo &info );
void IdleSound( void );
void AlertSound( void );
void LostEnemySound( void );

View File

@ -206,7 +206,7 @@ bool CHalfLife2::Damage_IsTimeBased( int iDmgType )
// Damage types that are time-based.
#ifdef HL2_EPISODIC
// This makes me think EP2 should have its own rules, but they are #ifdef all over in here.
return ( ( iDmgType & ( DMG_PARALYZE | DMG_NERVEGAS | DMG_POISON | DMG_RADIATION | DMG_DROWNRECOVER | DMG_SLOWBURN ) ) != 0 );
return ( ( iDmgType & ( DMG_PARALYZE | DMG_NERVEGAS | DMG_POISON | DMG_ACID | DMG_RADIATION | DMG_DROWNRECOVER | DMG_SLOWBURN ) ) != 0 );
#else
return BaseClass::Damage_IsTimeBased( iDmgType );
#endif

View File

@ -1149,7 +1149,7 @@ void C_BaseFlex::SetupWeights( const matrix3x4_t *pBoneToWorld, int nFlexWeightC
{
// hack in an initialization
LinkToGlobalFlexControllers( GetModelPtr() );
m_iBlink = AddGlobalFlexController( "UH" );
m_iBlink = AddGlobalFlexController( "blink" );
if ( SetupGlobalWeights( pBoneToWorld, nFlexWeightCount, pFlexWeights, pFlexDelayedWeights ) )
{