public void EndEvent(int type) { if (eventFinished) { return; } if (GhostRecorder.currentInstance != null) { if (eventActive.CanBeFailed() && type == 1) { GhostRecorder.currentInstance.StopRecording(false); } else { GhostRecorder.currentInstance.StopRecording(true); } } ContextualHudManager.currentInstance.ForceDriftEnd(); pm.AllowPlayerControl(false); SetEndGameScreen(type); eventFinished = true; IngameHudManager.currentInstance.SetHudVisibility(false); IngameHudManager.currentInstance.EndEvent(); if (eventActive.IsSeasonalEvent()) { GlobalGameData.currentInstance.SetLastEventPlayedResult(-1); } else { GlobalGameData.currentInstance.SetLastEventPlayedResult(GetPlayerResult()); } GlobalGameData.currentInstance.SaveData(); }