Skip to content

Commit

Permalink
Exhumed: fixed a few more bad velocities in queen code.
Browse files Browse the repository at this point in the history
  • Loading branch information
coelckers committed Nov 5, 2023
1 parent c039882 commit 3066df5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions source/games/exhumed/src/queen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ void DestroyAllEggs()

void SetHeadVel(DExhumedActor* pActor)
{
pActor->vel.XY() = pActor->spr.Angles.Yaw.ToVector() * 1024 * (1 << nVelShift);
pActor->vel.XY() = pActor->spr.Angles.Yaw.ToVector() * (1 << nVelShift);
}

//---------------------------------------------------------------------------
Expand Down Expand Up @@ -476,13 +476,13 @@ void BuildQueenEgg(int nQueen, int nVal)
pActor2->spr.yoffset = 0;
pActor2->spr.shade = -12;
setvalidpic(pActor2);
pActor2->spr.Angles.Yaw = pActor->spr.Angles.Yaw + RandomAngle9() - DAngle45;
pActor2->spr.Angles.Yaw = (pActor->spr.Angles.Yaw + RandomAngle9() - DAngle45).Normalized360();
pActor2->backuppos();

if (!nVal)
{
pActor2->spr.scale = DVector2(0.46875, 0.46875);
pActor2->vel.XY() = pActor2->spr.Angles.Yaw.ToVector() * 1024;
pActor2->vel.XY() = pActor2->spr.Angles.Yaw.ToVector();
pActor2->vel.Z = -6000 / 256.;
pActor2->spr.cstat = 0;
}
Expand Down Expand Up @@ -613,7 +613,7 @@ void AIQueenEgg::Tick(RunListEvent* ev)
}

pActor->spr.Angles.Yaw = nAngle;
pActor->vel.XY() = pActor->spr.Angles.Yaw.ToVector() * 512;
pActor->vel.XY() = pActor->spr.Angles.Yaw.ToVector() * 0.5;
}

break;
Expand Down Expand Up @@ -644,7 +644,7 @@ void AIQueenEgg::Tick(RunListEvent* ev)
}
[[fallthrough]];
case kHitWall:
pActor->spr.Angles.Yaw = DAngle45 + DAngle90 + RandomAngle9();
pActor->spr.Angles.Yaw = (DAngle45 + DAngle90 + RandomAngle9()).Normalized360();
pActor->VelFromAngle(-3);
pActor->vel.Z = (-RandomSize(5)) / 256.;
break;
Expand Down
4 changes: 2 additions & 2 deletions source/games/exhumed/src/random.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,11 @@ int RandomSize(int nSize)

DAngle RandomAngle9()
{
return mapangle(RandomSize(9));
return DAngle::fromBuild(RandomSize(9));
}

DAngle RandomAngle()
{
return mapangle(RandomSize(11));
return DAngle::fromBuild(RandomSize(11));
}
END_PS_NS

0 comments on commit 3066df5

Please sign in to comment.