Переглянути джерело

* Don't register the day/night timers if any one is set to 0

git-svn-id: https://svn.code.sf.net/p/rathena/svn/branches/stable@1258 54d463be-8e91-2dee-dedb-b68131a5f0ec
celest 20 роки тому
батько
коміт
32a3990f69
2 змінених файлів з 6 додано та 4 видалено
  1. 1 0
      Changelog-SVN.txt
  2. 5 4
      src/map/pc.c

+ 1 - 0
Changelog-SVN.txt

@@ -1,6 +1,7 @@
 Date	Added
 
 03/20
+        * Don't register the day/night timers if any one is set to 0 [celest]
 	* Fixed @storage / @gstorage ATcommands thanks2 Yor/Freya [Lupus]
         * Added 4 new card effects from 3/15's patch -- check item_bonus.txt [celest]
         * Added 'enable_ip_rules' to packet_athena.conf [celest]

+ 5 - 4
src/map/pc.c

@@ -7262,12 +7262,13 @@ int do_init_pc(void) {
 	pc_read_gm_account(0);
 #endif /* not TXT_ONLY */
 
-	// add night/day timer (by [yor])
-	add_timer_func_list(map_day_timer, "map_day_timer"); // by [yor]
-	add_timer_func_list(map_night_timer, "map_night_timer"); // by [yor]
-	{
+	if (battle_config.day_duration > 0 && battle_config.night_duration > 0) {
 		int day_duration = battle_config.day_duration;
 		int night_duration = battle_config.night_duration;
+		// add night/day timer (by [yor])
+		add_timer_func_list(map_day_timer, "map_day_timer"); // by [yor]
+		add_timer_func_list(map_night_timer, "map_night_timer"); // by [yor]
+
 		if (battle_config.night_at_start == 0) {
 			night_flag = 0; // 0=day, 1=night [Yor]
 			day_timer_tid = add_timer_interval(gettick() + day_duration + night_duration, map_day_timer, 0, 0, day_duration + night_duration);