#time off by an hour
The #time command is off by an hour. If you use #time it will return the current time, but that's one hour behind /time. This is because the code for #time counts from 0 to 23 (like a military clock) but eqTime.hour returns 1 - 24 due to the way the rest of EQ handles time.
This also happens when you use #time to set the time. If you say #time 23 then the time is set to 10pm (when it should be 11pm). It's not really a bug and I'm sure that most people who use it are pretty good at taking it into account. However, I suck at it. I have enough trouble adding and subtracting 12 to get PM time in military time =P. So, after that diatribe, the fix follows. in zone\command.cpp we need to modify the command_time function from: Code:
void command_time(Client *c, const Seperator *sep) Code:
void command_time(Client *c, const Seperator *sep) Code:
sprintf(timeMessage,"EQTime [%02d:%s%d %s]", Code:
sprintf(timeMessage,"EQTime [%02d:%s%d %s]", |
corollary
The corollary to this, of course, is that if you want Quests to use the same time settings when you are using quest::settime then you have to make a change to questmgr.cpp.
The change is from: Code:
void QuestManager::settime(int8 new_hour, int8 new_min) { Code:
void QuestManager::settime(int8 new_hour, int8 new_min) { iceclad\110115.pl kithicor\20250.pl lakerathe\51150.pl timorous\#_#_4.pl However, in looking at kithicor\20250.pl: Code:
if ($shifter==20) { #start night spawn The quest:settime(24,0); line later in the file would normally be out of place (military time is 0:00 - 23:59 in a day so there is no 24). However, due to the way that the emulator handles the time code...24 actually becomes midnight, or 0 with the questmgr change above so there's nothing to worry about and in my laziness I just left it. So on my server, with unchanged PEQ Quest files, night starts at 8pm. |
I should clarify the difference between 0 and 24 just for posterity:
Due to the way that the emulator handles the time code...after the questmgr change 24 actually becomes midnight on the next day (whereas 0 is midnight on the same day). But you know, now that I've explained the difference between 24 and 0 on the new code...does that mean that the old shifter functions kept resetting the time to midnight on the same day? It's groundhog day! |
All times are GMT -4. The time now is 02:48 AM. |
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.