From 0ad7e198d8b059ac7726e476aa94f2cf0d3ac01e Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 4 Feb 2024 12:21:57 +0100 Subject: [PATCH] fixed some bad copy/pasted dudeSlope calculations. --- source/games/blood/src/aibeast.cpp | 2 +- source/games/blood/src/aicaleb.cpp | 2 +- source/games/blood/src/aiunicult.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/source/games/blood/src/aibeast.cpp b/source/games/blood/src/aibeast.cpp index 89923190d9..11dce5b055 100644 --- a/source/games/blood/src/aibeast.cpp +++ b/source/games/blood/src/aibeast.cpp @@ -239,7 +239,7 @@ static void beastThinkChase(DBloodActor* actor) if (nDist < pDudeInfo->SeeDist() && nDeltaAngle <= pDudeInfo->Periphery()) { aiSetTarget(actor, actor->GetTarget()); - actor->dudeSlope = nDist == 0 ? 0 : int(target->spr.pos.Z - actor->spr.pos.Z / nDist); + actor->dudeSlope = nDist == 0 ? 0 : (target->spr.pos.Z - actor->spr.pos.Z) / nDist; if (nDist < 0x140 && nDist > 0xa0 && nDeltaAngle < DAngle15 && (target->spr.flags & 2) && target->IsPlayerActor() && Chance(0x8000)) { diff --git a/source/games/blood/src/aicaleb.cpp b/source/games/blood/src/aicaleb.cpp index d02673ac52..9e0009ac96 100644 --- a/source/games/blood/src/aicaleb.cpp +++ b/source/games/blood/src/aicaleb.cpp @@ -158,7 +158,7 @@ static void calebThinkChase(DBloodActor* actor) if (nDist < pDudeInfo->SeeDist() && nDeltaAngle <= pDudeInfo->Periphery()) { aiSetTarget(actor, actor->GetTarget()); - actor->dudeSlope = nDist == 0 ? 0 : target->spr.pos.Z - actor->spr.pos.Z / nDist; + actor->dudeSlope = nDist == 0 ? 0 : (target->spr.pos.Z - actor->spr.pos.Z) / nDist; if (nDist < 89.5625 && abs(nDeltaAngle) < DAngle1 * 5) { int hit = HitScan(actor, actor->spr.pos.Z, DVector3(dvec, 0), CLIPMASK1, 0); diff --git a/source/games/blood/src/aiunicult.cpp b/source/games/blood/src/aiunicult.cpp index ef9d56fc8b..9d739896e2 100644 --- a/source/games/blood/src/aiunicult.cpp +++ b/source/games/blood/src/aiunicult.cpp @@ -527,7 +527,7 @@ static void unicultThinkChase(DBloodActor* actor) if ((PlayClock & 64) == 0 && Chance(0x3000) && !spriteIsUnderwater(actor, false)) playGenDudeSound(actor, kGenDudeSndChasing); - actor->dudeSlope = dist == 0 ? 0 : target->spr.pos.Z - actor->spr.pos.Z / dist; + actor->dudeSlope = dist == 0 ? 0 : (target->spr.pos.Z - actor->spr.pos.Z) / dist; int curWeapon = actor->genDudeExtra.curWeapon; int weaponType = actor->genDudeExtra.weaponType;