/// <summary> /// Restore spell usages /// Direct call to Scripts AdvanceTimeByHoursNoRest /// </summary> public static void RestoreSpellsAndAbility() { GameObject underCursor = GameCursor.CharacterUnderCursor; CharacterStats stats = underCursor.GetComponent <CharacterStats>(); if (stats) { for (int i = 0; i < stats.SpellCastCount.Length; i++) { stats.SpellCastCount[i] = 0; } } IEnumerator <GenericAbility> enumerator = stats.ActiveAbilities.GetEnumerator(); try { while (enumerator.MoveNext()) { GenericAbility current = enumerator.Current; if (current == null) { continue; } current.RestoreCooldown(); } } finally { if (enumerator == null) { } enumerator.Dispose(); } }