Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

There's a bug in VehicleScoringInfo.getGapsBehindLeader #4

Open
MAHADEV-J opened this issue May 10, 2023 · 0 comments
Open

There's a bug in VehicleScoringInfo.getGapsBehindLeader #4

MAHADEV-J opened this issue May 10, 2023 · 0 comments

Comments

@MAHADEV-J
Copy link

I just realized that VehicleScoringInfo.getGapsBehindLeader, when byClass is false, actually returns the number of laps behind the next car in front, not the leader (so in fact it works the same as VehicleScoringInfo.getLapsBehindNextInFront(false)):

public final int getLapsBehindLeader(boolean byClass) {
    if (byClass) {
      this.scoringInfo.updateClassScoring();
      return this.lapsBehindLeaderByClass;
    } 
    return this.data.getLapsBehindNextInFront();
  }

I tried fixing this by changing it to

public final int getLapsBehindLeader(boolean byClass) {
    if (byClass) {
      this.scoringInfo.updateClassScoring();
      return this.lapsBehindLeaderByClass;
    } 
    return this.data.getLapsBehindLeader();
  }

but this doesn't work. It has something to do with the implementation of the abstract class _VehicleScoringInfoCapsule, I think, but I don't understand enough about the code to be sure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant