From 612ebb506e22c15b0739fa61221f0ec323e0a3c9 Mon Sep 17 00:00:00 2001 From: hondacrx Date: Mon, 18 Oct 2021 15:46:53 -0400 Subject: [PATCH] Fixes attempted to divide by zero when transport has no path. --- Source/Game/Entities/GameObject/GameObject.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/Game/Entities/GameObject/GameObject.cs b/Source/Game/Entities/GameObject/GameObject.cs index a446f198a..565eb5751 100644 --- a/Source/Game/Entities/GameObject/GameObject.cs +++ b/Source/Game/Entities/GameObject/GameObject.cs @@ -306,7 +306,7 @@ namespace Game.Entities case GameObjectTypes.Transport: m_goValue.Transport.AnimationInfo = Global.TransportMgr.GetTransportAnimInfo(goInfo.entry); m_goValue.Transport.PathProgress = Time.GetMSTime(); - if (m_goValue.Transport.AnimationInfo.Path != null) + if (!m_goValue.Transport.AnimationInfo.Path.Empty()) m_goValue.Transport.PathProgress -= m_goValue.Transport.PathProgress % GetTransportPeriod(); // align to period m_goValue.Transport.CurrentSeg = 0; m_goValue.Transport.StateUpdateTimer = 0; @@ -465,7 +465,7 @@ namespace Game.Entities break; } case GameObjectTypes.Transport: - if (m_goValue.Transport.AnimationInfo.Path == null) + if (m_goValue.Transport.AnimationInfo.Path.Empty()) break; m_goValue.Transport.PathProgress += diff; @@ -2390,7 +2390,7 @@ namespace Game.Entities public virtual uint GetTransportPeriod() { Cypher.Assert(GetGoInfo().type == GameObjectTypes.Transport); - if (m_goValue.Transport.AnimationInfo.Path != null) + if (!m_goValue.Transport.AnimationInfo.Path.Empty()) return m_goValue.Transport.AnimationInfo.TotalTime; return 0;