Skip to content

DNF should give 0 points instead of points equals to finished position #4

@KujawskiSzymon

Description

@KujawskiSzymon

When DNFing the car/player should get 0 points
Right now it is possible to dnf as the last man standing and get all the points
The code checks DNF with just hitpoints like:
dnfRaces.setText(Long.toString(filteredResults.stream().filter(r -> r.remainingHitpoints <= 0).count()));

maybe
private int getPoints(boolean isDnf, int position) {
if (!isDnf) {
return position > pointDistribution.length ? 0 : pointDistribution[position - 1];
}
else {
return 0;
}
}
should check if player HP is above 0 and then return 0 points if player DNF'ed

Ive tried to add DNF by myself but there are lines like
final int total2 = positions.get(id2).stream().mapToInt(this::getPoints).sum();
and im not able to understand whats going on, I also dont have java experience

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions