mirror of
https://github.com/phoboslab/wipeout-rewrite
synced 2024-12-26 09:59:04 +01:00
Fix championship rank calculation
This commit is contained in:
parent
8c9ec8871e
commit
a721eec118
1 changed files with 8 additions and 1 deletions
|
@ -207,7 +207,14 @@ void race_end() {
|
||||||
if (g.race_type == RACE_TYPE_CHAMPIONSHIP) {
|
if (g.race_type == RACE_TYPE_CHAMPIONSHIP) {
|
||||||
for (int i = 0; i < len(def.race_points_for_rank); i++) {
|
for (int i = 0; i < len(def.race_points_for_rank); i++) {
|
||||||
g.race_ranks[i].points = def.race_points_for_rank[i];
|
g.race_ranks[i].points = def.race_points_for_rank[i];
|
||||||
g.championship_ranks[g.race_ranks[i].pilot].points += def.race_points_for_rank[i];
|
|
||||||
|
// Find the pilot for this race rank in the championship table
|
||||||
|
for (int j = 0; j < len(g.championship_ranks); j++) {
|
||||||
|
if (g.race_ranks[i].pilot == g.championship_ranks[j].pilot) {
|
||||||
|
g.championship_ranks[j].points += def.race_points_for_rank[i];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
sort(g.championship_ranks, len(g.championship_ranks), sort_points_compare);
|
sort(g.championship_ranks, len(g.championship_ranks), sort_points_compare);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue