Skip to content

Commit

Permalink
Removed changes due to pathalogical issue with units facing west. To …
Browse files Browse the repository at this point in the history
…be investigated later.
  • Loading branch information
marcushutchings committed May 16, 2023
1 parent 22b62c9 commit 48e716d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions rts/Sim/MoveTypes/GroundMoveType.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1162,17 +1162,17 @@ void CGroundMoveType::ChangeHeading(short newHeading) {
if (owner->GetTransporter() != nullptr)
return;

wantedHeading = newHeading;
if (wantedHeading == owner->heading) {
turnSpeed *= owner->IsInAir(); // this is the side effect from GetDeltaHeading() that needs to be applied here.
return;
}
// if (newHeading == owner->heading) {
// wantedHeading = newHeading;
// // turnSpeed = Clamp(turnSpeed * (1 - owner->IsInAir()), -turnRate, turnRate); // this is the side effect from GetDeltaHeading() that needs to be applied here.
// return;
// }

#if (MODEL_TURN_INERTIA == 0)
const short rawDeltaHeading = pathController.GetDeltaHeading(pathID, wantedHeading, owner->heading, turnRate);
#else
// model rotational inertia (more realistic for ships)
const short rawDeltaHeading = pathController.GetDeltaHeading(pathID, wantedHeading, owner->heading, turnRate, turnAccel, BrakingDistance(turnSpeed, turnAccel), &turnSpeed);
const short rawDeltaHeading = pathController.GetDeltaHeading(pathID, (wantedHeading = newHeading), owner->heading, turnRate, turnAccel, BrakingDistance(turnSpeed, turnAccel), &turnSpeed);
#endif
const short absDeltaHeading = rawDeltaHeading * Sign(rawDeltaHeading);

Expand Down

0 comments on commit 48e716d

Please sign in to comment.