summaryrefslogtreecommitdiff
path: root/src/map/pc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/map/pc.c')
-rw-r--r--src/map/pc.c22
1 files changed, 9 insertions, 13 deletions
diff --git a/src/map/pc.c b/src/map/pc.c
index ce58ed4b9..414b38d58 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -9429,22 +9429,18 @@ int do_init_pc(void) {
add_timer(gettick() + autosave_interval, pc_autosave, 0, 0);
+ // 0=day, 1=night [Yor]
+ night_flag = battle_config.night_at_start ? 1 : 0;
+
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) {
- 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);
- night_timer_tid = add_timer_interval(gettick() + day_duration, map_night_timer, 0, 0, day_duration + night_duration);
- } else {
- night_flag = 1; // 0=day, 1=night [Yor]
- day_timer_tid = add_timer_interval(gettick() + night_duration, map_day_timer, 0, 0, day_duration + night_duration);
- night_timer_tid = add_timer_interval(gettick() + day_duration + night_duration, map_night_timer, 0, 0, day_duration + night_duration);
- }
+ // add night/day timer [Yor]
+ add_timer_func_list(map_day_timer, "map_day_timer");
+ add_timer_func_list(map_night_timer, "map_night_timer");
+
+ day_timer_tid = add_timer_interval(gettick() + (night_flag ? 0 : day_duration) + night_duration, map_day_timer, 0, 0, day_duration + night_duration);
+ night_timer_tid = add_timer_interval(gettick() + day_duration + (night_flag ? night_duration : 0), map_night_timer, 0, 0, day_duration + night_duration);
}
do_init_pc_groups();