summaryrefslogtreecommitdiff
path: root/src/map/pc.c
diff options
context:
space:
mode:
authorbrianluau <brianluau@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-10-28 01:58:27 +0000
committerbrianluau <brianluau@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-10-28 01:58:27 +0000
commitaff887e4fb431946d307b3fbf538a7e105b364be (patch)
treef93223e5cc741415ef46015461ca1da6c9ab961a /src/map/pc.c
parent1f3588e398185887e23bbb3504fa30973787d3e6 (diff)
downloadhercules-aff887e4fb431946d307b3fbf538a7e105b364be.tar.gz
hercules-aff887e4fb431946d307b3fbf538a7e105b364be.tar.bz2
hercules-aff887e4fb431946d307b3fbf538a7e105b364be.tar.xz
hercules-aff887e4fb431946d307b3fbf538a7e105b364be.zip
- 'night_at_start' config can now be used, even if day_duration/night_duration are 0.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16833 54d463be-8e91-2dee-dedb-b68131a5f0ec
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();