From b7e1de01ad1f0d00c9122b5877869770a2277e1d Mon Sep 17 00:00:00 2001 From: sigureling <1678348940@qq.com> Date: Fri, 17 May 2024 16:03:13 +0800 Subject: [PATCH] fix: :bug: fix overflow bug in logic.HaveView() --- CAPI/cpp/API/include/utils.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CAPI/cpp/API/include/utils.hpp b/CAPI/cpp/API/include/utils.hpp index b2046927..52ac4973 100755 --- a/CAPI/cpp/API/include/utils.hpp +++ b/CAPI/cpp/API/include/utils.hpp @@ -36,7 +36,7 @@ namespace AssistFunction { int32_t deltaX = newX - x; int32_t deltaY = newY - y; - double distance = deltaX * deltaX + deltaY * deltaY; + double distance = double(deltaX * deltaX) + double(deltaY * deltaY); THUAI7::PlaceType myPlace = map[GridToCell(x)][GridToCell(y)]; THUAI7::PlaceType newPlace = map[GridToCell(newX)][GridToCell(newY)]; if (newPlace == THUAI7::PlaceType::Shadow && myPlace != THUAI7::PlaceType::Shadow)