From 01f5c670364151f7c4e097b022374a1f777920e4 Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Fri, 4 Jan 2019 17:56:22 +0000 Subject: [PATCH] Fix spectator crash if replay does not define FinalGameTick. --- OpenRA.Mods.Common/Widgets/Logic/Ingame/GameTimerLogic.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/OpenRA.Mods.Common/Widgets/Logic/Ingame/GameTimerLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Ingame/GameTimerLogic.cs index 5e80e2999a..de11272941 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Ingame/GameTimerLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Ingame/GameTimerLogic.cs @@ -66,8 +66,10 @@ namespace OpenRA.Mods.Common.Widgets.Logic if (timerTooltip != null) { var connection = orderManager.Connection as ReplayConnection; - if (connection != null && connection.TickCount != 0) + if (connection != null && connection.FinalGameTick != 0) timerTooltip.GetTooltipText = () => "{0}% complete".F(world.WorldTick * 100 / connection.FinalGameTick); + else if (connection != null && connection.TickCount != 0) + timerTooltip.GetTooltipText = () => "{0}% complete".F(orderManager.NetFrameNumber * 100 / connection.TickCount); else timerTooltip.GetTooltipText = null; }