diff --git a/src/game/server/tf/halloween/spell/tf_spell_pickup.cpp b/src/game/server/tf/halloween/spell/tf_spell_pickup.cpp index bf3a08b65..cc7042275 100644 --- a/src/game/server/tf/halloween/spell/tf_spell_pickup.cpp +++ b/src/game/server/tf/halloween/spell/tf_spell_pickup.cpp @@ -31,6 +31,11 @@ void CSpellPickup::Spawn( void ) { BaseClass::Spawn(); m_nSkin = m_nTier; + + if ( !TFGameRules()->IsUsingSpells() ) + { + SetDisabled( true ); + } } //----------------------------------------------------------------------------- diff --git a/src/game/shared/tf/halloween/tf_weapon_spellbook.cpp b/src/game/shared/tf/halloween/tf_weapon_spellbook.cpp index fbfb75d5a..1d2153004 100644 --- a/src/game/shared/tf/halloween/tf_weapon_spellbook.cpp +++ b/src/game/shared/tf/halloween/tf_weapon_spellbook.cpp @@ -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; diff --git a/src/game/shared/tf/tf_gamerules.cpp b/src/game/shared/tf/tf_gamerules.cpp index dbfce0946..db4b33faf 100644 --- a/src/game/shared/tf/tf_gamerules.cpp +++ b/src/game/shared/tf/tf_gamerules.cpp @@ -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;