From 156369ac8aa4a0c369c23c069f7cb8ec1d280670 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 21 Dec 2021 12:00:01 +0100 Subject: [PATCH] - Blood: don't crash when cultists accidentally target themselves. --- source/games/blood/src/aicult.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/games/blood/src/aicult.cpp b/source/games/blood/src/aicult.cpp index d0db6fb9f..909bd6494 100644 --- a/source/games/blood/src/aicult.cpp +++ b/source/games/blood/src/aicult.cpp @@ -280,7 +280,7 @@ static void cultThinkChase(DBloodActor* actor) return; } int nDist = approxDist(dx, dy); - if (nDist <= pDudeInfo->seeDist) + if (nDist > 0 && nDist <= pDudeInfo->seeDist) { int nDeltaAngle = ((getangle(dx, dy) + 1024 - pSprite->ang) & 2047) - 1024; int height = (pDudeInfo->eyeHeight * pSprite->yrepeat) << 2;