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:
@@ -208,6 +208,9 @@ public final class CashOperationHandler extends AbstractMaplePacketHandler {
|
||||
Item item = mi.findByCashId(cashId);
|
||||
if (item == null) {
|
||||
return;
|
||||
} else if(c.getPlayer().getPetIndex(item.getPetId()) > -1) {
|
||||
chr.getClient().announce(MaplePacketCreator.serverNotice(1, "You cannot put the pet you currently equip into the Cash Shop inventory."));
|
||||
return;
|
||||
}
|
||||
cs.addToInventory(item);
|
||||
mi.removeSlot(item.getPosition());
|
||||
|
||||
@@ -28,6 +28,7 @@ import client.inventory.Item;
|
||||
import client.inventory.MapleInventory;
|
||||
import client.inventory.MapleInventoryType;
|
||||
import constants.ItemConstants;
|
||||
import constants.ServerConstants;
|
||||
import net.AbstractMaplePacketHandler;
|
||||
import server.MapleInventoryManipulator;
|
||||
import server.MapleItemInformationProvider;
|
||||
@@ -49,7 +50,7 @@ public final class StorageHandler extends AbstractMaplePacketHandler {
|
||||
final MapleStorage storage = chr.getStorage();
|
||||
|
||||
if (chr.getLevel() < 15){
|
||||
chr.message("You may only use this storage once you have reached level 15.");
|
||||
chr.message("You may only use the storage once you have reached level 15.");
|
||||
return;
|
||||
}
|
||||
if (mode == 4) { // take out
|
||||
@@ -127,6 +128,9 @@ public final class StorageHandler extends AbstractMaplePacketHandler {
|
||||
FilePrinter.print(FilePrinter.STORAGE + c.getAccountName() + ".txt", c.getPlayer().getName() + " stored " + item.getQuantity() + " " + itemName + " (" + item.getItemId() + ")\r\n");
|
||||
}
|
||||
}
|
||||
} else if (mode == 6) { // arrange items
|
||||
if(ServerConstants.USE_STORAGE_ITEM_SORT) storage.arrangeItems(c);
|
||||
c.announce(MaplePacketCreator.enableActions());
|
||||
} else if (mode == 7) { // meso
|
||||
int meso = slea.readInt();
|
||||
int storageMesos = storage.getMeso();
|
||||
|
||||
Reference in New Issue
Block a user