mirror of
https://github.com/mapbase-source/source-sdk-2013.git
synced 2025-01-13 07:17:57 +03:00
Fixed m_bDrawPlayerModelExternally drawing the weapon's viewmodel instead of its worldmodel
This commit is contained in:
parent
1c3b374d9e
commit
61bbe331dd
@ -502,18 +502,36 @@ int C_BaseCombatWeapon::DrawModel( int flags )
|
|||||||
// check if local player chases owner of this weapon in first person
|
// check if local player chases owner of this weapon in first person
|
||||||
C_BasePlayer *localplayer = C_BasePlayer::GetLocalPlayer();
|
C_BasePlayer *localplayer = C_BasePlayer::GetLocalPlayer();
|
||||||
|
|
||||||
if ( localplayer && localplayer->IsObserver() && GetOwner() )
|
if ( localplayer )
|
||||||
{
|
{
|
||||||
#ifdef MAPBASE
|
#ifdef MAPBASE
|
||||||
if (localplayer->m_bDrawPlayerModelExternally)
|
if (localplayer->m_bDrawPlayerModelExternally)
|
||||||
{
|
{
|
||||||
// If this isn't the main view, draw the weapon.
|
// If this isn't the main view, draw the weapon.
|
||||||
view_id_t viewID = CurrentViewID();
|
view_id_t viewID = CurrentViewID();
|
||||||
if (viewID != VIEW_MAIN && viewID != VIEW_INTRO_CAMERA)
|
if (viewID != VIEW_MAIN && viewID != VIEW_INTRO_CAMERA && (viewID != VIEW_SHADOW_DEPTH_TEXTURE || !localplayer->IsEffectActive(EF_DIMLIGHT)))
|
||||||
return BaseClass::DrawModel( flags );
|
{
|
||||||
|
// TODO: Is this inefficient?
|
||||||
|
int nModelIndex = GetModelIndex();
|
||||||
|
int nWorldModelIndex = GetWorldModelIndex();
|
||||||
|
if (nModelIndex != nWorldModelIndex)
|
||||||
|
{
|
||||||
|
SetModelIndex(nWorldModelIndex);
|
||||||
|
}
|
||||||
|
|
||||||
|
int iDraw = BaseClass::DrawModel(flags);
|
||||||
|
|
||||||
|
if (nModelIndex != nWorldModelIndex)
|
||||||
|
{
|
||||||
|
SetModelIndex(nModelIndex);
|
||||||
|
}
|
||||||
|
|
||||||
|
return iDraw;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
if ( localplayer->IsObserver() && GetOwner() )
|
||||||
|
{
|
||||||
// don't draw weapon if chasing this guy as spectator
|
// don't draw weapon if chasing this guy as spectator
|
||||||
// we don't check that in ShouldDraw() since this may change
|
// we don't check that in ShouldDraw() since this may change
|
||||||
// without notification
|
// without notification
|
||||||
@ -522,6 +540,7 @@ int C_BaseCombatWeapon::DrawModel( int flags )
|
|||||||
localplayer->GetObserverTarget() == GetOwner() )
|
localplayer->GetObserverTarget() == GetOwner() )
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return BaseClass::DrawModel( flags );
|
return BaseClass::DrawModel( flags );
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user