mirror of
https://gitlab.com/phoenix-dvpmt/mmocore.git
synced 2025-01-20 09:11:26 +01:00
Fixed issue #820 about skills not being locked when reallocating skill tree.
This commit is contained in:
parent
13440600a8
commit
aa6a1d7101
@ -377,6 +377,7 @@ public class PlayerData extends OfflinePlayerData implements Closable, Experienc
|
||||
*/
|
||||
public boolean unlock(Unlockable unlockable) {
|
||||
Validate.isTrue(!unlockable.isUnlockedByDefault(), "Cannot unlock an item unlocked by default");
|
||||
unlockable.whenUnlocked(this);
|
||||
final boolean wasLocked = unlockedItems.add(unlockable.getUnlockNamespacedKey());
|
||||
// Call the event synchronously
|
||||
if (wasLocked)
|
||||
@ -392,6 +393,7 @@ public class PlayerData extends OfflinePlayerData implements Closable, Experienc
|
||||
*/
|
||||
public boolean lock(Unlockable unlockable) {
|
||||
Validate.isTrue(!unlockable.isUnlockedByDefault(), "Cannot lock an item unlocked by default");
|
||||
unlockable.whenLocked(this);
|
||||
boolean wasUnlocked = unlockedItems.remove(unlockable.getUnlockNamespacedKey());
|
||||
if (wasUnlocked)
|
||||
//Calls the event synchronously
|
||||
|
@ -87,7 +87,7 @@ public class ClassSkill implements CooldownObject, Unlockable {
|
||||
@Override
|
||||
public void whenLocked(PlayerData playerData) {
|
||||
playerData.mapBoundSkills().forEach((slot, skill) -> {
|
||||
if (skill.equals(getUnlockNamespacedKey().split(":")[1]))
|
||||
if (skill.equalsIgnoreCase(getUnlockNamespacedKey().split(":")[1]))
|
||||
playerData.unbindSkill(slot);
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user