Commit 3bd5ed6e authored by Kenix Whisperwind's avatar Kenix Whisperwind

Merge branch '2.0.0' of gitlab.openrsc.com:open-rsc/Game into 2.0.0

parents ecfab10a 63d18d3b
......@@ -472,17 +472,19 @@ public class Bank {
return;
}
for (int i = 0; i < Equipment.slots; i++) {
if (player.getEquipment().get(i) != null)
player.getEquipment().remove(i);
}
if (Server.getServer().getConfig().WANT_EQUIPMENT_TAB) {
//Attempt to equip the preset equipment
int wearableId;
for (int i = 0; i < presets[slot].equipment.length; i++) {
Item presetEquipment = presets[slot].equipment[i];
if (presetEquipment.getDef() == null) {
player.getEquipment().equip(i,null);
player.updateWornItems(i,
player.getSettings().getAppearance().getSprite(i));
if (presetEquipment.getDef() == null)
continue;
}
presetEquipment.setWielded(false);
if (itemsOwned.containsKey(presetEquipment.getID())) {
int presetAmount = presetEquipment.getAmount();
......
......@@ -121,6 +121,14 @@ public class Equipment {
}
}
public void remove(int slot) {
synchronized (list) {
list[slot] = null;
ActionSender.sendEquipmentStats(player, slot);
player.updateWornItems(slot,
player.getSettings().getAppearance().getSprite(slot));
}
}
public int remove(int id, int amount) {
synchronized (list) {
for (int i = 0; i < slots; i++) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment