Check if map is compatible to avoid script crash
This commit is contained in:
parent
3124754b1e
commit
405bd533f8
@ -221,6 +221,19 @@ Net_CurrentRoundNb = Map_ValidRoundsNb + 1;
|
||||
|
||||
declare Text[] AccountIdsOfPlayers for This = [];
|
||||
declare CMapLandmark[] Landmarks = Map::GetFinishesAndMultilaps();
|
||||
|
||||
declare Boolean MapIsCompatible;
|
||||
foreach (Landmark in Landmarks) {
|
||||
if (Map::IsMultilap(Landmark)) {
|
||||
MapIsCompatible = True;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!MapIsCompatible) {
|
||||
UIManager.UIAll.QueueMessage(3000, 1, CUIConfig::EMessageDisplay::Big, _("This map is not valid"));
|
||||
MB_Sleep(3000);
|
||||
MB_StopMap();
|
||||
} else {
|
||||
declare CMapLandmark PlayerLM;
|
||||
declare Integer LandmarkIndex for This = 0;
|
||||
AccountIdsOfPlayers = [];
|
||||
@ -263,6 +276,7 @@ StateMgr::ForcePlayersStates([StateMgr::C_State_Playing]);
|
||||
CarRank::Update(CarRank::C_SortCriteria_BestRace);
|
||||
Race::EnableIntroDuringMatch(False);
|
||||
UIManager.UIAll.SendChat("$<$ff3$> Stay the most time on the structure. $<$ff9GL HF!$>");
|
||||
}
|
||||
***
|
||||
|
||||
***Match_PlayLoop***
|
||||
|
Loading…
Reference in New Issue
Block a user