Edge case fix

Fixed an edge case where there were no cards left and it caused an error
This commit is contained in:
2025-07-29 00:34:47 +02:00
parent 352a3a8de6
commit 53c07b69f8

View File

@@ -64,7 +64,10 @@ public class CardManager : MonoBehaviour
Debug.Log($"Available cards: {string.Join(", ", availableCards.Select(x => x.Skill))}"); Debug.Log($"Available cards: {string.Join(", ", availableCards.Select(x => x.Skill))}");
Debug.Log($"Unlocked skills: {string.Join(", ", unlockedSkills)}"); Debug.Log($"Unlocked skills: {string.Join(", ", unlockedSkills)}");
if (shuffled.Count <= 0)
return;
float step = Screen.width / shuffled.Count; float step = Screen.width / shuffled.Count;
float pos = step - Screen.width / (2*shuffled.Count); float pos = step - Screen.width / (2*shuffled.Count);