void CSector::SetWeatherChance( bool fRain, int iChance ) { ADDTOCALLSTACK("CSector::SetWeatherChance"); // Set via the client. // Transfer from snow to rain does not work ! must be DRY first. if ( iChance > 100 ) iChance = 100; if ( iChance < 0 ) { // just set back to defaults. SetDefaultWeatherChance(); } else if ( fRain ) { m_RainChance = static_cast<unsigned char>(iChance | LIGHT_OVERRIDE); } else { m_ColdChance = static_cast<unsigned char>(iChance | LIGHT_OVERRIDE); } // Recalc the weather immediatly. SetWeather( GetWeatherCalc()); }
CSector::CSector() { m_ListenItems = 0; m_RainChance = 0; // 0 to 100% m_ColdChance = 0; // Will be snow if rain chance success. SetDefaultWeatherChance(); m_dwFlags = 0; m_fSaveParity = false; }
CSector::CSector() : CTimedObject(PROFILE_SECTORS) { m_ListenItems = 0; m_RainChance = 0; // 0 to 100% m_ColdChance = 0; // Will be snow if rain chance success. SetDefaultWeatherChance(); m_dwFlags = 0; m_fSaveParity = false; GoSleep(); // Every sector is sleeping at start, they only awake when any player enter (this eases the load at startup). }