From 2e6fbd0679df9d4bb0a7e69c98f3c3cf92b664d6 Mon Sep 17 00:00:00 2001 From: leozide Date: Mon, 13 Nov 2017 11:16:29 -0800 Subject: [PATCH] Fixed crash using the old move tool. --- common/view.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/common/view.cpp b/common/view.cpp index 843631a8..b30ac88b 100644 --- a/common/view.cpp +++ b/common/view.cpp @@ -2315,6 +2315,7 @@ void View::StartTracking(lcTrackButton TrackButton) mTrackUpdated = false; mMouseDownX = mInputState.x; mMouseDownY = mInputState.y; + mMouseDownPiece = nullptr; lcTool Tool = GetCurrentTool(); switch (Tool) @@ -2788,7 +2789,7 @@ void View::OnMouseMove() } } } - else if (mTrackTool == LC_TRACKTOOL_MOVE_XYZ) + else if (mTrackTool == LC_TRACKTOOL_MOVE_XYZ && mMouseDownPiece) { lcMatrix44 NewPosition = GetPieceInsertPosition(true, mMouseDownPiece); lcVector3 Distance = NewPosition.GetTranslation() - mMouseDownPosition;