Fixing incorrect cherry-pick from MapLabs

This commit is contained in:
Derek Dik 2018-11-01 15:15:38 -04:00
parent ec29683e10
commit 4ff24d3814
4 changed files with 21 additions and 23 deletions

View File

@ -1471,24 +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 +1494,29 @@ void CDetailObjectSystem::LevelInitPreEntity()
void CDetailObjectSystem::LevelInitPostEntity()
{
if ( m_DetailObjects.Count() || m_DetailSpriteDict.Count() )
{
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;
}
}
}
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