fix issues
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user