This commit is contained in:
Rowedahelicon 2025-03-30 02:59:08 -06:00 committed by GitHub
commit facaacdc75
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 17 additions and 3 deletions

View file

@ -31,6 +31,11 @@ void CSpellPickup::Spawn( void )
{
BaseClass::Spawn();
m_nSkin = m_nTier;
if ( !TFGameRules()->IsUsingSpells() )
{
SetDisabled( true );
}
}
//-----------------------------------------------------------------------------

View file

@ -1065,6 +1065,9 @@ void CTFSpellBook::CreateSpellJar( const Vector &position, const QAngle &angles,
//-----------------------------------------------------------------------------
void CTFSpellBook::RollNewSpell( int iTier, bool bForceReroll /*= false*/ )
{
if ( !TFGameRules()->IsUsingSpells() )
return;
// do not do anything if we already have a spell for low tier, always roll for high tier
if ( m_iSpellCharges > 0 && iTier == 0 && !bForceReroll )
return;

View file

@ -741,7 +741,7 @@ ConVar tf_force_holidays_off( "tf_force_holidays_off", "0", FCVAR_NOTIFY | FCVAR
#endif // GAME_DLL
);
ConVar tf_birthday( "tf_birthday", "0", FCVAR_NOTIFY | FCVAR_REPLICATED );
ConVar tf_spells_enabled( "tf_spells_enabled", "0", FCVAR_NOTIFY | FCVAR_REPLICATED, "Enable to Allow Halloween Spells to be dropped and used by players" );
ConVar tf_spells_enabled( "tf_spells_enabled", "-1", FCVAR_NOTIFY | FCVAR_REPLICATED, "-1 Default (Map-based)\n0 - Force off\n1 - Force on" );
ConVar tf_caplinear( "tf_caplinear", "1", FCVAR_REPLICATED | FCVAR_DEVELOPMENTONLY, "If set to 1, teams must capture control points linearly." );
ConVar tf_stalematechangeclasstime( "tf_stalematechangeclasstime", "20", FCVAR_REPLICATED | FCVAR_DEVELOPMENTONLY, "Amount of time that players are allowed to change class in stalemates." );
@ -3661,9 +3661,15 @@ CTFGameRules::HalloweenScenarioType CTFGameRules::GetHalloweenScenario( void ) c
//-----------------------------------------------------------------------------
bool CTFGameRules::IsUsingSpells( void ) const
{
if ( tf_spells_enabled.GetBool() )
if ( tf_spells_enabled.GetInt() == 0 )
{
return false;
}
else if ( tf_spells_enabled.GetInt() > 0 )
{
return true;
}
if ( IsHalloweenScenario( CTFGameRules::HALLOWEEN_SCENARIO_HIGHTOWER ) )
return true;