From d82ff771f4465e375da9d294d48d2e29717bfdeb Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Sat, 29 Jun 2019 14:30:53 +0200 Subject: [PATCH] Fix checking cursor target This causes a crashes when compiled a debug build with Clang --- Source/cursor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/cursor.cpp b/Source/cursor.cpp index 88329f210..923f07c3f 100644 --- a/Source/cursor.cpp +++ b/Source/cursor.cpp @@ -446,7 +446,7 @@ void CheckCursMove() cursmx = mx + 1; cursmy = my + 1; } - if (!towner[pcursmonst]._tSelFlag) { /// BUGFIX: Add check 'pcursmonst != -1' + if (pcursmonst != -1 && !towner[pcursmonst]._tSelFlag) { pcursmonst = -1; } }