Skip to content

There's a bug in VehicleScoringInfo.getGapsBehindLeader #4

@MAHADEV-J

Description

@MAHADEV-J

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions