Files
Bubberstation/code/controllers
SkyratBot 352bf3aacd [MIRROR] Fix ping_update errors when certain operations resolve to scientific notation. (#8190)
* Fix ping_update errors when certain operations resolve to scientific notation (#61443)

Sometimes when logging on Campbell, fancy chat fails to load and my non-fancy chat is spammed with the following.

image

In addition, ping fails to update correct on the status tab when this happens.

Hypothesis:
Sometimes world.time can report a number that displays as scientific notation when converted to text.

The following code leads to calling the update_ping verb.
winset(C, null, "command=.update_ping+[world.time+world.tick_lag*TICK_USAGE_REAL/100]")

I suspect what's happening is world.time is being converted to text and you're getting the following command:
command=.update_ping+2.1313e

And this is causing an error in update_ping since it can't resolve 2.1313e as a valid number.

Wrapping that in text2num with 32 significant figures (arbitrary number, heat death of the universe proof by several orders of magnitude) means the update_ping verb always gets a number that isn't in scientific notation.

* Fix ping_update errors when certain operations resolve to scientific notation.

Co-authored-by: Timberpoes <silent_insomnia_pp@hotmail.co.uk>
2021-09-15 03:34:05 +01:00
..
2021-06-15 18:12:49 +01:00