void ChrisHoliday::calcit(int year) { if (year==_lastyear) return; _lastyear = year; _days.clear(); calc_easter(); calc_christmas(); }
void another_hour(int mode) { time_info.hours++; if (time_info.hours == sunrise[time_info.month][0]) { weather_info.sunlight = SUN_RISE; send_to_outdoor("На востоке показались первые солнечные лучи.\r\n", SUN_CONTROL); // Gorrah: Закомментил вызов тут и далее по коду, пока не будет приведено в нормальный виж. // Вы с дуба рухнули - каждый тик бегать по ~100-150к объектов в мире? // Надо делать через собственный лист объектов с такими тригами в собственном же неймспейсе // См. как сделаны slow DT например. //script_timechange_trigger_check(25);//рассвет } else if (time_info.hours == sunrise[time_info.month][0] + 1) { weather_info.sunlight = SUN_LIGHT; send_to_outdoor("Начался день.\r\n", SUN_CONTROL); //script_timechange_trigger_check(26);//день } else if (time_info.hours == sunrise[time_info.month][1]) { weather_info.sunlight = SUN_SET; send_to_outdoor("Солнце медленно исчезло за горизонтом.\r\n", SUN_CONTROL); //script_timechange_trigger_check(27);//закат } else if (time_info.hours == sunrise[time_info.month][1] + 1) { weather_info.sunlight = SUN_DARK; send_to_outdoor("Началась ночь.\r\n", SUN_CONTROL); //script_timechange_trigger_check(28);//ночь } if (time_info.hours >= HOURS_PER_DAY) /* Changed by HHS due to bug ??? */ { time_info.hours = 0; time_info.day++; weather_info.moon_day++; if (weather_info.moon_day >= MOON_CYCLE) weather_info.moon_day = 0; weather_info.week_day_mono++; if (weather_info.week_day_mono >= WEEK_CYCLE) weather_info.week_day_mono = 0; weather_info.week_day_poly++; if (weather_info.week_day_poly >= POLY_WEEK_CYCLE) weather_info.week_day_poly = 0; if (time_info.day >= DAYS_PER_MONTH) { time_info.day = 0; time_info.month++; if (time_info.month >= MONTHS_PER_YEAR) { time_info.month = 0; time_info.year++; calc_easter(); } } } //script_timechange_trigger_check(24);//просто смена часа //script_timechange_trigger_check(time_info.hours);//выполняется для конкретного часа if ((weather_info.sunlight == SUN_SET || weather_info.sunlight == SUN_DARK) && weather_info.sky == SKY_LIGHTNING && weather_info.moon_day >= FULLMOONSTART && weather_info.moon_day <= FULLMOONSTOP) { send_to_outdoor("Лунный свет заливает равнины тусклым светом.\r\n", SUN_CONTROL); } }