From ed947b354f653e0dd73e8682019ec572eaf57f0a Mon Sep 17 00:00:00 2001 From: kiriharu Date: Sat, 21 Sep 2024 13:00:51 +0300 Subject: [PATCH] FIX: Stop giving exp to task and call steps related to it when task already marked as completed --- .../src/main/kotlin/com/willfp/ecoquests/tasks/Task.kt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoquests/tasks/Task.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoquests/tasks/Task.kt index 95f2db3..0da821a 100644 --- a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoquests/tasks/Task.kt +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoquests/tasks/Task.kt @@ -146,6 +146,11 @@ class Task( * Give experience directly */ fun giveExperience(player: Player, amount: Double) { + + if (player.profile.read(hasCompletedKey)) { + return + } + val requiredXp = getExperienceRequired(player) val newXp = player.profile.read(xpKey) + amount