mirror of
https://github.com/BentoBoxWorld/Challenges.git
synced 2024-11-24 19:45:14 +01:00
Fix a bug with challenge deletion.
If challenge has been left in a level, then system did not remove challenge from it and was kept as ghost challenge, preventing from completing level.
This commit is contained in:
parent
9d45f08fb1
commit
e3e3191e6c
@ -1669,11 +1669,22 @@ public class ChallengesManager
|
||||
{
|
||||
if (this.challengeCacheData.containsKey(challenge.getUniqueId()))
|
||||
{
|
||||
// First remove challenge from its owner level.
|
||||
|
||||
if (!challenge.getLevel().equals(FREE))
|
||||
{
|
||||
ChallengeLevel level = this.getLevel(challenge.getLevel());
|
||||
|
||||
if (level != null)
|
||||
{
|
||||
this.removeChallengeFromLevel(challenge, level);
|
||||
}
|
||||
}
|
||||
|
||||
// Afterwards remove challenge from the database.
|
||||
|
||||
this.challengeCacheData.remove(challenge.getUniqueId());
|
||||
this.challengeDatabase.deleteObject(challenge);
|
||||
|
||||
this.addon.getPlugin().getPlaceholdersManager().
|
||||
unregisterPlaceholder("challenges_challenge_repetition_count_" + challenge.getUniqueId());
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user