mirror of
https://github.com/ChocoTaco1/TacoServer.git
synced 2026-07-16 08:34:43 +00:00
Redo Limit/CurrentMission check
Minimum for min/max check to avoid loop
This commit is contained in:
parent
c82143731f
commit
a182ab0723
1 changed files with 14 additions and 9 deletions
|
|
@ -41,7 +41,7 @@ function MapRepetitionChecker( %game )
|
||||||
//Do work
|
//Do work
|
||||||
for(%x = 1; %x <= $MRC::PastMapsDepth; %x++)
|
for(%x = 1; %x <= $MRC::PastMapsDepth; %x++)
|
||||||
{
|
{
|
||||||
if( $MRC::PrevMap[%x] !$= "" && $MRC::PrevMap[%x] $= $EvoCachedNextMission )
|
if( $MRC::PrevMap[%x] !$= "" && $MRC::PrevMap[%x] $= $EvoCachedNextMission || $CurrentMission $= $EvoCachedNextMission )
|
||||||
MapRepetitionCheckerFindRandom();
|
MapRepetitionCheckerFindRandom();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -69,14 +69,15 @@ function MapRepetitionChecker( %game )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function MapRepetitionCheckerFindRandom()
|
function MapRepetitionCheckerFindRandom(%redone)
|
||||||
{
|
{
|
||||||
//Make sure GetRandomMaps.cs is present
|
//Make sure GetRandomMaps.cs is present
|
||||||
if(!$GetRandomMapsLoaded)
|
if(!$GetRandomMapsLoaded)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
//Backup
|
//Backup
|
||||||
$SetNextMissionRestore = $EvoCachedNextMission;
|
if(%redone $="")
|
||||||
|
$SetNextMissionRestore = $EvoCachedNextMission;
|
||||||
|
|
||||||
//Do work
|
//Do work
|
||||||
//getRandomMap() is in GetRandomMaps.cs
|
//getRandomMap() is in GetRandomMaps.cs
|
||||||
|
|
@ -89,15 +90,19 @@ function MapRepetitionCheckerFindRandom()
|
||||||
if($MRC::PrevMap[%x] !$= "" && $MRC::PrevMap[%x] $= $EvoCachedNextMission)
|
if($MRC::PrevMap[%x] !$= "" && $MRC::PrevMap[%x] $= $EvoCachedNextMission)
|
||||||
%redo = 1;
|
%redo = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Make sure its within maplimits
|
//Make sure its within maplimits
|
||||||
%newmaplimits = $Host::MapPlayerLimits[$EvoCachedNextMission, $CurrentMissionType];
|
%newmaplimits = $Host::MapPlayerLimits[$EvoCachedNextMission, $CurrentMissionType];
|
||||||
%min = getWord(%newmaplimits,0);
|
%min = getWord(%newmaplimits,0);
|
||||||
%max = getWord(%newmaplimits,1);
|
%max = getWord(%newmaplimits,1);
|
||||||
if(%min > $AllPlayerCount || $AllPlayerCount > %max)
|
if((%min > $AllPlayerCount || $AllPlayerCount > %max) && $AllPlayerCount > 2 )
|
||||||
%redo = 1;
|
%redo = 1;
|
||||||
|
|
||||||
if( %redo )
|
if( %redo && %redone < 3 )
|
||||||
MapRepetitionCheckerFindRandom();
|
{
|
||||||
|
%redone++;
|
||||||
|
MapRepetitionCheckerFindRandom(%redone);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
error(formatTimeString("HH:nn:ss") SPC "Map Repetition Corrected from" SPC $SetNextMissionRestore SPC "to" SPC $EvoCachedNextMission @ "." );
|
error(formatTimeString("HH:nn:ss") SPC "Map Repetition Corrected from" SPC $SetNextMissionRestore SPC "to" SPC $EvoCachedNextMission @ "." );
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue