From 3a3812480f3e84c9feeecf548a19cbcf151a1c75 Mon Sep 17 00:00:00 2001 From: Ka0rX Date: Wed, 4 Jan 2023 12:53:58 +0100 Subject: [PATCH] Debug Skill Binding Issue. --- .../java/net/Indyuce/mmocore/api/player/PlayerData.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/MMOCore-API/src/main/java/net/Indyuce/mmocore/api/player/PlayerData.java b/MMOCore-API/src/main/java/net/Indyuce/mmocore/api/player/PlayerData.java index 31a8fc3a..a9d3649a 100644 --- a/MMOCore-API/src/main/java/net/Indyuce/mmocore/api/player/PlayerData.java +++ b/MMOCore-API/src/main/java/net/Indyuce/mmocore/api/player/PlayerData.java @@ -1115,8 +1115,8 @@ public class PlayerData extends OfflinePlayerData implements Closable, Experienc */ public void bindPassiveSkill(int slot, @NotNull PassiveSkill skill) { Validate.notNull(skill, "Skill cannot be null"); - final int maxBound = getProfess().getMaxBoundActiveSkills(); - if (slot > 0 && boundPassiveSkills.size() >= maxBound) { + final int maxBound = getProfess().getMaxBoundPassiveSkills(); + if (slot >= 0 && boundPassiveSkills.size() >= maxBound) { final @NotNull PassiveSkill current = boundPassiveSkills.set(slot, skill); if (current != null) current.unregister(mmoData); @@ -1151,7 +1151,7 @@ public class PlayerData extends OfflinePlayerData implements Closable, Experienc */ public void bindActiveSkill(int slot, ClassSkill skill) { Validate.notNull(skill, "Skill cannot be null"); - if (slot > 0 && boundSkills.size() >= getProfess().getMaxBoundActiveSkills()) + if (slot >= 0 && boundSkills.size() >= getProfess().getMaxBoundActiveSkills()) boundSkills.set(slot, skill); else boundSkills.add(skill);