fix negative trees bug

This commit is contained in:
unsoftcapped3 2022-12-15 19:52:40 -08:00 committed by GitHub
parent 93ea38b589
commit 226962699a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -762,6 +762,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
Decimal.times(computedAutoPlantingAmount.value, diff) Decimal.times(computedAutoPlantingAmount.value, diff)
); );
saplings.value = Decimal.sub(saplings.value, amountPlanted); saplings.value = Decimal.sub(saplings.value, amountPlanted);
if(Decimal.gte(saplings.value, totalTrees.value)) saplings.value = totalTrees.value;
}); });
const netSaplingGain = computed(() => const netSaplingGain = computed(() =>