Repository navigation
Fixes negative seconds visually (but not underlying cause) - #1949
EagleWorks wants to merge 1 commit into
Conversation
Spawn point details can currently show negative seconds. These should be substracted from 60 to get the correct second count. Note: This only fixes a formatting issue, not any issues with regard to actual spawn times. For discussion on the latter, see Issue RocketMap#1944
|
The question is, is that a front-end issue or if there is something going wrong in the python part!? |
|
@aRengo as per the summary, this fixes purely a display issue (a function that takes a value and returns a string for incorporation in the html), and doesn't touch any underlying issues with regard to whether or not the supplied value is actually correct. For that, see Issue #1944 and its discussion thread :) |
sebastienvercammen
left a comment
There was a problem hiding this comment.
I've changed the title and description to be clearer on what it does and doesn't fix.
I'm personally on the fence about this PR, since negative seconds should never have been a problem in the first place if the back-end does its job properly. While it does fix the display for those cases where we get negative seconds (= bad), it tries to fix something that shouldn't exist, so I would keep this PR unmerged to make it very clear to us when something is going wrong with our timing.
In this case, I would fix the back-end issue rather than applying a front-end bandage.
Overall a good PR, but I vote no.
|
Yep - I vote the same if the underlying cause is coming up on fixes. Might be more appropriate to put checks for incorrect values earlier in the code (from the calling function, say) and display errors (even if just in dev console) explicitly? |
|
Imo, while this is a well PR code-wise it just fixes a symptom and not the bug itself. So I vote no, too :-/ |
Spawn point details can currently show negative seconds. These should
be substracted from 60 to get the correct second count.
Note: This only fixes a formatting issue, not any issues with regard to
actual spawn times. For discussion on the latter, see Issue #1944
Description
Adds a ternary operator to subtract negative seconds from 60 to correct the negative seconds issue.
Motivation and Context
Negative seconds don't make sense in display formats, especially not when they're only negative if they're single-digit.
Seb edit: This fixes the visual issue caused by #1941, but not its underlying cause.
How Has This Been Tested?
Three-fold: In-map, using Calc, and using a javascript iteration over a range of numbers.
This change only affects displayed times in the spawn point details on the map.
Screenshots (if appropriate):
https://cloud.githubusercontent.com/assets/3775662/24132943/989aeda0-0dcf-11e7-9335-42e971672d6a.png
Types of changes
Checklist:
The last two points are just a reminder to self that the front-end needs documentation, period :)