9
0
mirror of https://github.com/Auxilor/EcoQuests.git synced 2025-12-19 15:09:22 +00:00

FIX: Stop giving exp to task and call steps related to it when task already marked as completed

This commit is contained in:
kiriharu
2024-09-21 13:00:51 +03:00
parent 5e51c369bb
commit ed947b354f

View File

@@ -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