Skip to content

Commit

Permalink
fixed some bad copy/pasted dudeSlope calculations.
Browse files Browse the repository at this point in the history
  • Loading branch information
coelckers committed Feb 4, 2024
1 parent 57f4dc7 commit 0ad7e19
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion source/games/blood/src/aibeast.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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))
{
Expand Down
2 changes: 1 addition & 1 deletion source/games/blood/src/aicaleb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion source/games/blood/src/aiunicult.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 0ad7e19

Please sign in to comment.