-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
world:getTime returns the wrong value #93
Comments
I tested with "unix" which seems to be working fine, returning 1666721659. "month" returns 16, as in Mas, even though it should return 2, as in Tanos. Not sure if this breaks any scripts. Could potentially be urgent, as searches for |
So far the following scripts have shown up in the script error log as having been broken due to this: |
Hrm, it isn't even 2038 yet... A quick fix could be to move the time logics to a script function and see if the error can be reproduced. But of course, a proper fix of the server function is preferred. Any hint on the root cause? |
Root cause is likely in this line: Illarion-Server/src/WorldIMPLTools.cpp Line 610 in e6f9437
Using int here results in a variable overflow later on. Illarion time passes 3x as fast, so as Illarion time started in RL year 2000, we accumulated more than seconds of game life than can be stored in an int variable. A solution would be to change the variable type to long or long long - given this does not break stuff further down the line |
This needs to be reverted once the time function works properly again: |
world:getTime() has suddenly started returning negative values
Discovered via this recent report.
I looked into it and found via a
log(world:getTime("day")
where it returned -4 (which matches the current login message of -4th of Mas) that it is the server function itself that is returning faulty values all of a sudden.The text was updated successfully, but these errors were encountered: