mirror of
https://github.com/fortressforever/fortressforever-2013.git
synced 2025-02-15 16:41:19 +00:00
- Fixed info_ff_goal not staying active if active_time was set to -1.
- Fixed info_ff_goal being rendered while disabled.
This commit is contained in:
parent
6c08c02252
commit
f73ad0309c
4 changed files with 43 additions and 7 deletions
|
@ -362,7 +362,12 @@ void CFF_SH_BaseFFGoal::ActivateGoal()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Start the deactivate timer.
|
// Start the deactivate timer.
|
||||||
if( m_fActiveTime )
|
if( m_fActiveTime < 0.0f )
|
||||||
|
{
|
||||||
|
// If they set the active_time to -1 we don't deactivate.
|
||||||
|
SetThink( NULL );
|
||||||
|
}
|
||||||
|
else if( m_fActiveTime )
|
||||||
{
|
{
|
||||||
SetThink( &CFF_SH_BaseFFGoal::DeactivateGoal );
|
SetThink( &CFF_SH_BaseFFGoal::DeactivateGoal );
|
||||||
SetNextThink( gpGlobals->curtime + m_fActiveTime );
|
SetNextThink( gpGlobals->curtime + m_fActiveTime );
|
||||||
|
|
|
@ -96,17 +96,18 @@ private:
|
||||||
CUtlVector<CHandle<CFF_SH_BaseFFGoal>> m_Criteria_GoalsAreDisabled;
|
CUtlVector<CHandle<CFF_SH_BaseFFGoal>> m_Criteria_GoalsAreDisabled;
|
||||||
|
|
||||||
#ifdef GAME_DLL
|
#ifdef GAME_DLL
|
||||||
private:
|
protected:
|
||||||
void Input_Enable( inputdata_t &inputdata );
|
virtual void Input_Enable( inputdata_t &inputdata );
|
||||||
void Input_Disable( inputdata_t &inputdata );
|
virtual void Input_Disable( inputdata_t &inputdata );
|
||||||
void Input_Activate( inputdata_t &inputdata );
|
void Input_Activate( inputdata_t &inputdata );
|
||||||
void Input_Inactivate( inputdata_t &inputdata );
|
void Input_Inactivate( inputdata_t &inputdata );
|
||||||
|
|
||||||
COutputEvent m_Output_OnEnabled;
|
COutputEvent m_Output_OnEnabled;
|
||||||
COutputEvent m_Output_OnDisabled;
|
COutputEvent m_Output_OnDisabled;
|
||||||
COutputEvent m_Output_OnActive;
|
COutputEvent m_Output_OnActive;
|
||||||
COutputEvent m_Output_OnInactive;
|
COutputEvent m_Output_OnInactive;
|
||||||
|
|
||||||
|
private:
|
||||||
string_t m_iszActivationSound;
|
string_t m_iszActivationSound;
|
||||||
string_t m_iszResetSound;
|
string_t m_iszResetSound;
|
||||||
|
|
||||||
|
|
|
@ -46,6 +46,14 @@ void CFF_SH_InfoFFGoal::Spawn()
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef GAME_DLL
|
#ifdef GAME_DLL
|
||||||
|
void CFF_SH_InfoFFGoal::Activate()
|
||||||
|
{
|
||||||
|
BaseClass::Activate();
|
||||||
|
|
||||||
|
if( !IsGoalEnabled() )
|
||||||
|
AddEffects( EF_NODRAW );
|
||||||
|
}
|
||||||
|
|
||||||
void CFF_SH_InfoFFGoal::OnTouching( CBaseEntity *pOther )
|
void CFF_SH_InfoFFGoal::OnTouching( CBaseEntity *pOther )
|
||||||
{
|
{
|
||||||
BaseClass::OnTouching( pOther );
|
BaseClass::OnTouching( pOther );
|
||||||
|
@ -59,7 +67,23 @@ void CFF_SH_InfoFFGoal::ActivateGoal()
|
||||||
|
|
||||||
void CFF_SH_InfoFFGoal::DeactivateGoal()
|
void CFF_SH_InfoFFGoal::DeactivateGoal()
|
||||||
{
|
{
|
||||||
RemoveEffects( EF_NODRAW );
|
if( IsGoalEnabled() )
|
||||||
|
RemoveEffects( EF_NODRAW );
|
||||||
|
|
||||||
BaseClass::DeactivateGoal();
|
BaseClass::DeactivateGoal();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CFF_SH_InfoFFGoal::Input_Enable( inputdata_t &inputdata )
|
||||||
|
{
|
||||||
|
BaseClass::Input_Enable( inputdata );
|
||||||
|
|
||||||
|
if( !IsGoalActivated() )
|
||||||
|
RemoveEffects( EF_NODRAW );
|
||||||
|
}
|
||||||
|
|
||||||
|
void CFF_SH_InfoFFGoal::Input_Disable( inputdata_t &inputdata )
|
||||||
|
{
|
||||||
|
BaseClass::Input_Disable( inputdata );
|
||||||
|
AddEffects( EF_NODRAW );
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -34,6 +34,8 @@ public:
|
||||||
virtual void Spawn( void );
|
virtual void Spawn( void );
|
||||||
|
|
||||||
#ifdef GAME_DLL
|
#ifdef GAME_DLL
|
||||||
|
virtual void Activate( void );
|
||||||
|
|
||||||
virtual void OnTouching( CBaseEntity *pOther );
|
virtual void OnTouching( CBaseEntity *pOther );
|
||||||
virtual void ActivateGoal( void );
|
virtual void ActivateGoal( void );
|
||||||
virtual void DeactivateGoal( void );
|
virtual void DeactivateGoal( void );
|
||||||
|
@ -44,6 +46,10 @@ public:
|
||||||
// We don't set this in the base_goal because so many other entities are derived from it.
|
// We don't set this in the base_goal because so many other entities are derived from it.
|
||||||
return SetTransmitState( FL_EDICT_ALWAYS );
|
return SetTransmitState( FL_EDICT_ALWAYS );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual void Input_Enable( inputdata_t &inputdata );
|
||||||
|
virtual void Input_Disable( inputdata_t &inputdata );
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue