I’m trying to add a -75% chance that IsSessionCrashingViable will be true.
// Token: 0x06001B24 RID: 6948 RVA: 0x000C92BC File Offset: 0x000C74BC
private bool IsSessionCrashingViable(RacingVehicle inVehicle)
{
SessionManager sessionManager = Game.instance.sessionManager;
float num = sessionManager.currentSessionWeather.GetNormalizedTrackWater() * 0.001f;
if (RandomUtility.GetRandom01() <= num)
{
this.AddCrash();
}
if (RandomUtility.GetRandom01() <= .25)
{
this.IsSessionCrashingViable(inVehicle) = true; ***<-- The line I'm having trouble with***
}
bool flag = Game.instance.vehicleManager.safetyVehicle.IsReadyToGoOut() || sessionManager.championship.rules.safetyCarUsage > ChampionshipRules.SafetyCarUsage.RealSafetyCar;
bool isTutorialActiveInCurrentGameState = Game.instance.tutorialSystem.isTutorialActiveInCurrentGameState;
bool flag2 = sessionManager.sessionType == SessionDetails.SessionType.Race;
bool flag3 = sessionManager.lap > 1 && sessionManager.lapCount - sessionManager.lap >= 3;
bool flag4 = this.mActiveChunk.crashCount > 0;
bool flag5 = Game.instance.sessionManager.flag == SessionManager.Flag.Green;
if (!flag2)
{
return flag5 && !isTutorialActiveInCurrentGameState && !inVehicle.behaviourManager.isOutOfRace && (this.mVehiclesCantCrash == null || !this.mVehiclesCantCrash.Contains(inVehicle)) && flag4;
}
return flag5 && !isTutorialActiveInCurrentGameState && flag && flag4 && flag3 && !inVehicle.behaviourManager.isOutOfRace && (this.mVehiclesCantCrash == null || !this.mVehiclesCantCrash.Contains(inVehicle)) && inVehicle.sessionEvents.IsReadyTo(SessionEvents.EventType.Crash);
}
If I remove (inVehicle) I get “There is no argument given that corresponds to the required formal parameter ‘inVehicle’ of ‘CrashDirector.IsSessionCrashingViable(Racing Vehicle)’ and if I add (RacingVehicle inVehicle) it says ‘Racing Vehicle is a type, which is not valid in the given context’
New contributor
Parker Benson is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1