Merge pull request #9628 from abcdefg30/luatime
Fix Utils.FormatTime not working properly on different game speeds
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user