Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- stategraph_basicrace_prerace_handler_stateenter = function(l_1_arg0, l_1_arg1, l_1_arg2)
- Game.ResetCopsForRestart()
- Game.SetCopsEnabled(l_1_arg0.CopsInRace)
- Game.SetChanceOfRain(l_1_arg0.ChanceOfRain)
- Debug.Print("Pre-race setup")
- l_1_arg2.NextGoal = {}
- l_1_arg2.GoalCount = {}
- l_1_arg2.GoalList = {}
- l_1_arg2.LapsLeft = {}
- l_1_arg2.InRace = {}
- l_1_arg2.Element = {}
- l_1_arg2.Character = {}
- l_1_arg2.NumAutoSpawned = 0
- l_1_arg2.AutoSpawnedTriggers = {}
- for l_1_3 = 1, l_1_arg2.NumRacers do
- l_1_arg2.GoalList[l_1_3] = l_1_arg0.Checkpoint
- l_1_arg2.Character[l_1_3] = Game.GetRacerCharacter(l_1_3)
- if l_1_arg2.Character[l_1_3] ~= nil and l_1_arg2.Character[l_1_3].CannedPath ~= nil then
- Debug.Print("Racer " .. l_1_3 .. " using canned path")
- l_1_arg2.GoalList[l_1_3] = l_1_arg2.Character[l_1_3].CannedPath
- end
- l_1_arg2.GoalCount[l_1_3] = 0
- if l_1_arg2.GoalList[l_1_3] ~= nil then
- l_1_arg2.GoalCount[l_1_3] = l_1_arg2.GoalList[l_1_3].Count
- end
- local l_1_6 = l_1_arg0.racefinish
- local l_1_7 = 0
- if l_1_arg2.GoalCount[l_1_3] > 0 then
- l_1_6 = l_1_arg2.GoalList[l_1_3][1]
- l_1_7 = 1
- end
- l_1_arg2.NextGoal[l_1_3] = l_1_7
- l_1_arg2.LapsLeft[l_1_3] = l_1_arg0.NumLaps
- l_1_arg2.InRace[l_1_3] = true
- l_1_arg2.Element[l_1_3] = Game.GetRacerElement(l_1_3)
- Game.SetRacerGoal(l_1_3, l_1_6)
- end
- l_1_arg2.NumberFinished = 0
- l_1_arg2.NumAllowedForLaps = {}
- local l_1_3 = l_1_arg2.NumAllowedForLaps
- local l_1_4 = l_1_arg0.NumLaps
- l_1_3[l_1_4] = l_1_arg2.NumRacers + 1
- l_1_3 = l_1_arg0.NumLaps
- l_1_3 = l_1_3 - 1
- l_1_4 = 0
- l_1_3 = l_1_3 - -1
- for l_1_5 = l_1_3, l_1_4, -1 do
- l_1_arg2.NumAllowedForLaps[l_1_3] = l_1_arg2.NumAllowedForLaps[l_1_3 + 1] - l_1_arg0.KnockoutsPerLap
- if l_1_arg2.NumAllowedForLaps[l_1_3] < 1 then
- l_1_arg2.NumAllowedForLaps[l_1_3] = 1
- end
- end
- l_1_arg2.NumCheckpoints = 0
- l_1_3 = l_1_arg0.Checkpoint
- if l_1_3 ~= nil then
- l_1_3 = l_1_arg0.Checkpoint
- l_1_3 = l_1_3.Count
- l_1_arg2.NumCheckpoints = l_1_3
- end
- l_1_3 = RaceStatus
- l_1_3, l_1_4 = l_1_3:ClearCheckpoints, l_1_3
- l_1_3(l_1_4)
- l_1_3 = 1
- l_1_4 = l_1_arg2.NumCheckpoints
- l_1_3 = l_1_3 - 1
- for l_1_3 = l_1_3, l_1_4 do
- local , l_1_4, l_1_5 =
- l_1_4 = RaceStatus
- l_1_4, l_1_5 = l_1_4:AddCheckpoint, l_1_4
- l_1_4(l_1_5, l_1_arg0.Checkpoint[l_1_3])
- end
- l_1_3 = RaceStatus
- l_1_3, l_1_4 = l_1_3:AddCheckpoint, l_1_3
- l_1_3(l_1_4, l_1_arg0.racefinish)
- l_1_3 = Game
- l_1_3 = l_1_3.IsOnlineGame
- l_1_3 = l_1_3()
- if not l_1_3 then
- l_1_3 = Game
- l_1_3 = l_1_3.IsLANGame
- l_1_3 = l_1_3()
- end
- l_1_arg2.OnlineRace = l_1_3
- l_1_3 = l_1_arg2.CameFromNIS
- if not l_1_3 then
- l_1_3 = Game
- l_1_3 = l_1_3.WarpPlayerToTrigger
- l_1_4 = l_1_arg0.racestart
- l_1_3(l_1_4)
- end
- l_1_3 = Game
- l_1_3 = l_1_3.RestoreStartPositions
- l_1_3()
- l_1_3 = false
- l_1_arg2.CameFromNIS = l_1_3
- l_1_3 = RaceStatus
- l_1_3, l_1_4 = l_1_3:NotifyScriptWhenLoaded, l_1_3
- l_1_3(l_1_4)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement