From e9271025dc66a4100bcdffd674a028b8e32ccbc2 Mon Sep 17 00:00:00 2001 From: wraitii Date: Thu, 12 Nov 2015 20:57:50 +0000 Subject: [PATCH] Forgot to serialize a new unitMotion variable, resulting in OOS on rejoin. This was SVN commit r17245. --- source/simulation2/components/CCmpUnitMotion.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source/simulation2/components/CCmpUnitMotion.cpp b/source/simulation2/components/CCmpUnitMotion.cpp index 8a9935dda8..52dfe5bcb1 100644 --- a/source/simulation2/components/CCmpUnitMotion.cpp +++ b/source/simulation2/components/CCmpUnitMotion.cpp @@ -364,6 +364,8 @@ public: serialize.Bool("moving", m_Moving); serialize.Bool("facePointAfterMove", m_FacePointAfterMove); + serialize.NumberU8("tries", m_Tries, 0, 255); + SerializeVector()(serialize, "long path", m_LongPath.m_Waypoints); SerializeVector()(serialize, "short path", m_ShortPath.m_Waypoints); @@ -1413,6 +1415,7 @@ void CCmpUnitMotion::RequestShortPath(const CFixedVector2D &from, const PathGoal if (!cmpPathfinder) return; + // wrapping around on m_Tries isn't really a problem so don't check for overflow. fixed searchRange = std::max(SHORT_PATH_MIN_SEARCH_RANGE * ++m_Tries, goal.DistanceToPoint(from)); if (searchRange > SHORT_PATH_MAX_SEARCH_RANGE) searchRange = SHORT_PATH_MAX_SEARCH_RANGE;