fix issues

This commit is contained in:
2025-12-26 11:49:20 +01:00
parent d08ec10b40
commit 68ae9da22a
44 changed files with 505 additions and 179 deletions

View File

@@ -102,8 +102,8 @@ export class RaceResultGeneratorWithIncidents {
// Generate specific incidents
const incidents: IncidentRecord[] = [];
for (let i = 0; i < incidentCount; i++) {
const incidentType = this.selectIncidentType(position, totalDrivers, i);
const lap = this.selectIncidentLap(i + 1, incidentCount);
const incidentType = this.selectIncidentType(position, totalDrivers);
const lap = this.selectIncidentLap(i + 1);
incidents.push({
type: incidentType,
@@ -119,7 +119,7 @@ export class RaceResultGeneratorWithIncidents {
/**
* Select appropriate incident type based on context
*/
private static selectIncidentType(position: number, totalDrivers: number, _incidentIndex: number): IncidentType {
private static selectIncidentType(position: number, totalDrivers: number): IncidentType {
// Different incident types have different probabilities
const incidentProbabilities: Array<{ type: IncidentType; weight: number }> = [
{ type: 'track_limits', weight: 40 }, // Most common
@@ -154,7 +154,7 @@ export class RaceResultGeneratorWithIncidents {
/**
* Select appropriate lap for incident
*/
private static selectIncidentLap(incidentNumber: number, _totalIncidents: number): number {
private static selectIncidentLap(incidentNumber: number): number {
// Spread incidents throughout the race
const lapRanges = [
{ min: 1, max: 5 }, // Early race