From e65465c5397ef1517f8c0c47ae050cf2ba5abdfc Mon Sep 17 00:00:00 2001 From: abcdefg30 Date: Sat, 24 Oct 2015 23:42:32 +0200 Subject: [PATCH] Fix Utils.FormatTime not working properly on different game speeds --- OpenRA.Mods.Common/Scripting/Global/UtilsGlobal.cs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/OpenRA.Mods.Common/Scripting/Global/UtilsGlobal.cs b/OpenRA.Mods.Common/Scripting/Global/UtilsGlobal.cs index c5aba7459b..a7c4c55016 100644 --- a/OpenRA.Mods.Common/Scripting/Global/UtilsGlobal.cs +++ b/OpenRA.Mods.Common/Scripting/Global/UtilsGlobal.cs @@ -19,12 +19,8 @@ namespace OpenRA.Mods.Common.Scripting [ScriptGlobal("Utils")] public class UtilsGlobal : ScriptGlobal { - readonly World world; public UtilsGlobal(ScriptContext context) - : base(context) - { - world = context.World; - } + : base(context) { } [Desc("Calls a function on every element in a collection.")] public void Do(LuaValue[] collection, LuaFunction func) @@ -106,7 +102,7 @@ namespace OpenRA.Mods.Common.Scripting [Desc("Returns the ticks formatted to HH:MM:SS.")] public string FormatTime(int ticks, bool leadingMinuteZero = true) { - return WidgetUtils.FormatTime(ticks, leadingMinuteZero, world.Timestep); + return WidgetUtils.FormatTime(ticks, leadingMinuteZero, 40); } } }