Added Storage's "Arrange Items" + Fixed equipped pet on CS issue
Implemented the "Arrange Items" Storage feature (merge & sort items on the Storage). Fixed items from different ownerships being merged together when trying to swap their positions. Fixed a bug where putting equipped pets onto Cash Shop inventory would cause a crash the returning to the game.
This commit is contained in:
@@ -27,6 +27,7 @@ import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.HashMap;
|
||||
@@ -266,6 +267,23 @@ public class MapleStorage {
|
||||
lock.unlock();
|
||||
}
|
||||
}
|
||||
|
||||
public void arrangeItems(MapleClient c) {
|
||||
lock.lock();
|
||||
try {
|
||||
MapleStorageInventory msi = new MapleStorageInventory(c, items);
|
||||
msi.mergeItems();
|
||||
items = msi.sortItems();
|
||||
|
||||
for (MapleInventoryType type : MapleInventoryType.values()) {
|
||||
typeItems.put(type, new ArrayList<>(items));
|
||||
}
|
||||
|
||||
c.announce(MaplePacketCreator.arrangeStorage(slots, items));
|
||||
} finally {
|
||||
lock.unlock();
|
||||
}
|
||||
}
|
||||
|
||||
public int getMeso() {
|
||||
return meso;
|
||||
|
||||
Reference in New Issue
Block a user