And may the following snippet helps somebody to prevent the problem with rain/snow/fog destroying the night effect. Just add it in the beginning of Weather::ReGenerate() in weather.cpp. So you will have sun weather in the night. (May adjust the time).Code: [Select] // night cycle if time between 21:00 and 6:00 time_t curTime = time(NULL); tm localTm; ACE_OS::localtime_r(&curTime, &localTm); if (localTm.tm_hour>=21 || localTm.tm_hour<=6) { TC_LOG_INFO("weather", "It's night time."); m_type = WEATHER_TYPE_FINE; m_grade = 0.0f; return false; }
// night cycle if time between 21:00 and 6:00 time_t curTime = time(NULL); tm localTm; ACE_OS::localtime_r(&curTime, &localTm); if (localTm.tm_hour>=21 || localTm.tm_hour<=6) { TC_LOG_INFO("weather", "It's night time."); m_type = WEATHER_TYPE_FINE; m_grade = 0.0f; return false; }
No idea if the light setting can be fixed to work with the nights, but you can make it so weather only happens during day. Quote from: "Magnus"And may the following snippet helps somebody to prevent the problem with rain/snow/fog destroying the night effect. Just add it in the beginning of Weather::ReGenerate() in weather.cpp. So you will have sun weather in the night. (May adjust the time).Code: [Select] // night cycle if time between 21:00 and 6:00 time_t curTime = time(NULL); tm localTm; ACE_OS::localtime_r(&curTime, &localTm); if (localTm.tm_hour>=21 || localTm.tm_hour<=6) { TC_LOG_INFO("weather", "It's night time."); m_type = WEATHER_TYPE_FINE; m_grade = 0.0f; return false; }
// night cycle if time between 21:00 and 6:00 time_t t; short hour; t = time(NULL); hour = localtime(&t)->tm_hour; if (hour>=21 || hour<=6) { TC_LOG_INFO("weather", "It's night time."); m_type = WEATHER_TYPE_FINE; m_grade = 0.0f; return false; }
Please note that Milly didn't create that code. Thanks goes to its original author (on this forum), Magnus. Though I suspect he got the code from another forum anyway.
Quote from: "kojak488"Please note that Milly didn't create that code. Thanks goes to its original author (on this forum), Magnus. Though I suspect he got the code from another forum anyway.I already quoted Magnus in my post. Check it again
Quote from: "Milly"Quote from: "kojak488"Please note that Milly didn't create that code. Thanks goes to its original author (on this forum), Magnus. Though I suspect he got the code from another forum anyway.I already quoted Magnus in my post. Check it again Why are you telling me? I'm not the one that thanked you. You should direct your post at the other guy.
Um, perhaps it's because you're suggesting that I took the code as my own? And that's sorta a dick thing to do.
Quote from: "Milly"Um, perhaps it's because you're suggesting that I took the code as my own? And that's sorta a dick thing to do.I suggested no such thing. Valkryst was thanking you and made no mention of Magnus. I pointed out to him that the thanks goes to Magnus rather than you.Reading is hard, eh?
// night cycle if time between 21:00 and 6:00time_t curTime = time(NULL);tm localTm;localtime_r(&curTime, &localTm); if (localTm.tm_hour>=21 || localTm.tm_hour<=6) { TC_LOG_INFO("weather", "It's night time."); m_type = WEATHER_TYPE_FINE; m_grade = 0.0f; return false; }
Quote from: "kojak488"Quote from: "Milly"Um, perhaps it's because you're suggesting that I took the code as my own? And that's sorta a dick thing to do.I suggested no such thing. Valkryst was thanking you and made no mention of Magnus. I pointed out to him that the thanks goes to Magnus rather than you.Reading is hard, eh?And in no way did Valkryst ever suggest that I made the code. He thanked me for sharing it. Reading sure is hard kojak.