1- -- Raphael's Library v1.5.0
2- -- Last Updated: 22 /03/2015 - 20:53 UTC
1+ -- Raphael's Library v1.5.1
2+ -- Last Updated: 30 /03/2015 - 14:52 UTC
33-- Released for WindBot v2.6.2
44
5- RAPHAEL_LIB = ' 1.5.0 '
5+ RAPHAEL_LIB = ' 1.5.1 '
66
77--[[
8- * Changelog v1.5.0
8+ * Changelog v1.5.1
99 *
10- * - Added closebattlelist.
11- * - Added a few more ITEMS_* constants.
12- * - Minor fixes and improvements on Area class.
13- * - Added and improved a shitload of table functions. (Gotta edit this before official release)
10+ * - Fixed typo on table.reverse.
11+ * - Fixed very rare issue with utctime().
1412 *
1513--]]
1614
@@ -494,11 +492,18 @@ end
494492 * Returns the current time of day, in seconds, on UTC timezone.
495493 *
496494 * @since 0.1.0
495+ * @updated 1.5.1
497496 *
498497 * @returns {number} - UTC time of day in seconds
499498--]]
500499function utctime ()
501- return tosec (os.date (' !%X' ))
500+ local t = os.date (' !%X' )
501+
502+ -- Apparently os.date('!%X') returns the time with AM/PM appended on some
503+ -- computers; this ignores anything before and after the actual timestamp
504+ t = table .first (t :match (' (%d%d:%d%d:%d%d)' ))
505+
506+ return tosec (t )
502507end
503508
504509--[[
@@ -1853,6 +1858,7 @@ end
18531858 * Returns a copy of the table with the indexes reversed.
18541859 *
18551860 * @since 1.5.0
1861+ * @updated 1.5.1
18561862 *
18571863 * @param {table} self - The target table
18581864 *
@@ -1861,9 +1867,9 @@ end
18611867function table .reverse (self )
18621868 local r = {}
18631869
1864- for i , v in ipairs (self )
1870+ for i , v in ipairs (self ) do
18651871 r [# self - i + 1 ] = v
1866- do
1872+ end
18671873
18681874 return r
18691875end
0 commit comments