1. Hello,

    Im trying to fix the TwigsDecay mod, its been a while and im quite sure these lines of code is causing the issue. Anyone able to help?

    Code:
            void OnTick() {
                if (!initialized)
                    return;
                var now = DateTime.Now;
                if (lastUpdate > now.AddMinutes(-timespan))
                    return;
                lastUpdate = now;
                int blocksDecayed = 0;
                int blocksDestroyed = 0;
                 var allBlocks = UnityEngine.Object.FindObjectsOfType<BuildingBlock>();
                int amount;
                foreach (var block in allBlocks) {
                    if (block.isDestroyed)
                        continue;
                    string grade;
                    string name;
                    try {
                        grade = block.grade.ToString();
                        name = block.blockDefinition.fullName.Substring(29); // foundation.prefab
                    } catch (Exception) {
                        continue;
                    }
                    if (!blocks.Contains(name))
                        continue;
                    if (damage.TryGetValue(grade, out amount) && amount > 0) {
                        ++blocksDecayed;
                        if (!decay(block, amount))
                            ++blocksDestroyed;
                    }