diff --git a/mapchooser_extended/scripting/mapchooser_extended.sp b/mapchooser_extended/scripting/mapchooser_extended.sp index 2ea40267..f1da0520 100644 --- a/mapchooser_extended/scripting/mapchooser_extended.sp +++ b/mapchooser_extended/scripting/mapchooser_extended.sp @@ -2328,22 +2328,17 @@ stock int InternalGetMapTimeRestriction(const char[] map) int MinTime = InternalGetMapMinTime(map); int MaxTime = InternalGetMapMaxTime(map); - // Wrap around if max is less then min. - if (MaxTime <= MinTime) - { - MaxTime += 2400; - - if (CurTime <= MinTime) - CurTime += 2400; - } + //Wrap around. + CurTime = (CurTime <= MinTime) ? CurTime + 2400 : CurTime; + MaxTime = (MaxTime <= MinTime) ? MaxTime + 2400 : MaxTime; if (!(MinTime <= CurTime <= MaxTime)) { - // Wrap around if min is less then current. - if (MinTime <= CurTime) - MinTime += 2400; + //Wrap around. + MinTime = (MinTime <= CurTime) ? MinTime + 2400 : MinTime; + MinTime = (MinTime <= MaxTime) ? MinTime + 2400 : MinTime; - // Convert our 'time' to minutes; + // Convert our 'time' to minutes. CurTime = (RoundToFloor(float(CurTime / 100)) * 60) + (CurTime % 100); MinTime = (RoundToFloor(float(MinTime / 100)) * 60) + (MinTime % 100); MaxTime = (RoundToFloor(float(MaxTime / 100)) * 60) + (MaxTime % 100);