From 53c07b69f83124509618aba9c68c6643ac7ae59f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20P=C4=9Bnkava?= Date: Tue, 29 Jul 2025 00:34:47 +0200 Subject: [PATCH] Edge case fix Fixed an edge case where there were no cards left and it caused an error --- 3D blobici/Assets/Scripts/Cards/CardManager.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/3D blobici/Assets/Scripts/Cards/CardManager.cs b/3D blobici/Assets/Scripts/Cards/CardManager.cs index 7a631ee..246331b 100644 --- a/3D blobici/Assets/Scripts/Cards/CardManager.cs +++ b/3D blobici/Assets/Scripts/Cards/CardManager.cs @@ -64,7 +64,10 @@ public class CardManager : MonoBehaviour Debug.Log($"Available cards: {string.Join(", ", availableCards.Select(x => x.Skill))}"); Debug.Log($"Unlocked skills: {string.Join(", ", unlockedSkills)}"); - + + if (shuffled.Count <= 0) + return; + float step = Screen.width / shuffled.Count; float pos = step - Screen.width / (2*shuffled.Count);