Issue information

Issue ID
#3035
Status
Fixed
Severity
None
Started
Hercules Elf Bot
Apr 30, 2009 0:23
Last Post
Hercules Elf Bot
Apr 30, 2009 0:23
Confirmation
N/A

Hercules Elf Bot - Apr 30, 2009 0:23

Originally posted by [b]BrianL[/b]
http://www.eathena.ws/board/index.php?autocom=bugtracker&showbug=3035

When a Convex Mirror tells you the time until the MVP respawns, the time is off by 1 minute.

Ex: use a convex mirrors each minute, for a few minutes before a MVP spawns and you'll see
Boss Monster, 'Golden Thief Bug' will appear in 00 hour(s) and 02 minute(s).
Boss Monster, 'Golden Thief Bug' will appear in 00 hour(s) and 01 minute(s).
Boss Monster, 'Golden Thief Bug' will appear within 1 minute.
Boss Monster, 'Golden Thief Bug' will appear in 00 hour(s) and 00 minute(s).

It's because in clif_bossmapinfo(), when integer division is used to converted seconds to hours : minutes, the leftover seconds are lost instead of being rounded up to the next whole minute.
One solution would be add 60 seconds to the time (it would have the effect of rounding up to the next whole minute).

CODE
Index: src/map/clif.c
===================================================================
--- src/map/clif.c    (revision 13708)
+++ src/map/clif.c    (working copy)
@@ -12496,7 +12496,7 @@
            unsigned int seconds;
            int hours, minutes;

-            seconds = DIFF_TICK(timer_data->tick, gettick()) / 1000;
+            seconds = DIFF_TICK(timer_data->tick, gettick()) / 1000 + 60;
            hours = seconds / (60 * 60);
            seconds = seconds - (60 * 60 * hours);
            minutes = seconds / 60;


This post has been edited by BrianL: Apr 29 2009, 07:28 PM