From 32d329d81e6e7f957d226218a3966f57bfd494da Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Sun, 7 Apr 2024 23:35:08 +0200 Subject: [PATCH] fixed a possible crash when generating YASC message --- checkmove.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/checkmove.cpp b/checkmove.cpp index f6917ccb..8f541029 100644 --- a/checkmove.cpp +++ b/checkmove.cpp @@ -390,7 +390,7 @@ EX void create_yasc_message() { if(captures.size() == 2 && context.size() == 1 && cwt.at->type == 6) { vector dirs; forCellIdEx(c1, i, cwt.at) for(auto cap: captures) if(cap.first == c1) dirs.push_back(i); - if(abs(dirs[0]-dirs[1]) == 3) { + if(isize(dirs) == 2 && abs(dirs[0]-dirs[1]) == 3) { auto c1 = captures.begin(); c1++; yasc_message = XLAT("pinched by %the1 and %the2", captures.begin()->second, c1->second); }