try to fix an issue where active abilities can be kept after resetting skilltree
This commit is contained in:
@@ -109,6 +109,13 @@ public class PlayerSkillData {
|
||||
return abilitySlots.clone();
|
||||
}
|
||||
|
||||
public void clearAbilitySlots() {
|
||||
for (int i = 0; i < abilitySlots.length; i++) {
|
||||
abilitySlots[i] = null;
|
||||
abilityCooldowns[i] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
public void setCooldown(int slot, int ticks) {
|
||||
int idx = slot - 1;
|
||||
if (idx < 0 || idx >= abilityCooldowns.length) return;
|
||||
@@ -215,9 +222,10 @@ public class PlayerSkillData {
|
||||
unlockedNodes.clear();
|
||||
activeTags.clear();
|
||||
unlockedAbilities.clear();
|
||||
clearAbilitySlots();
|
||||
}
|
||||
|
||||
public void sync(ServerPlayer player) {
|
||||
PacketHandler.syncSkillsTo(player);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user