Skip to content

Commit 31bae1d

Browse files
committed
fix: Don't use Math.Clamp pre Unity2021
1 parent bd0657a commit 31bae1d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Runtime/Game/Utilities/LootLockerTimezoneConverter.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -649,7 +649,9 @@ public static bool isValidWindowsTimezone(string timezone)
649649

650650
public static string convertUTCOffsetToIanaTzString(int utcOffset)
651651
{
652+
#if UNITY_2021_1_OR_NEWER
652653
utcOffset = Math.Clamp(utcOffset, -12, 14);
654+
#endif
653655
if (utcOffset < 0)
654656
{
655657
return $"Etc/GMT+{Math.Abs(utcOffset)}"; // Note the reversed sign for Etc/GMT
@@ -666,7 +668,9 @@ public static string convertUTCOffsetToIanaTzString(int utcOffset)
666668

667669
public static string convertGMTOffsetToIanaTzString(int gmtOffset)
668670
{
671+
#if UNITY_2021_1_OR_NEWER
669672
gmtOffset = Math.Clamp(gmtOffset, -14, 12);
673+
#endif
670674
if (gmtOffset < 0)
671675
{
672676
return $"Etc/GMT-{Math.Abs(gmtOffset)}";

0 commit comments

Comments
 (0)